.jp-onboarding[hidden] { display: none !important; }

.jp-onboarding {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 59, 48, .18), transparent 34%),
        radial-gradient(circle at 82% 88%, rgba(150, 12, 12, .2), transparent 38%),
        rgba(0, 0, 0, .9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    font-family: "Plus Jakarta Sans", sans-serif;
}

html.jp-preferences-open,
html.jp-preferences-open body { overflow: hidden !important; }

.jp-onboarding-dialog {
    position: relative;
    width: min(1120px, 100%);
    max-height: min(900px, calc(100vh - 48px));
    overflow: auto;
    color: #fff;
    background: linear-gradient(145deg, rgba(18, 18, 18, .98), rgba(5, 5, 5, .99));
    border: 1px solid rgba(255, 59, 48, .35);
    border-radius: 34px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .85), 0 0 55px rgba(255, 59, 48, .14);
}

.jp-onboarding-dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(110deg, rgba(255, 59, 48, .08), transparent 24%, transparent 72%, rgba(255, 59, 48, .05));
}

.jp-onboarding-close {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 2147483647;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: #aaa;
    font-size: 25px;
    cursor: pointer;
    touch-action: manipulation;
    pointer-events: auto;
    transition: .2s ease;
}

.jp-onboarding-close:hover { color: #fff; border-color: #ff3b30; background: rgba(255, 59, 48, .14); }

.jp-onboarding-head {
    position: relative;
    padding: 40px 80px 28px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.jp-kicker {
    color: #ff3b30;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.jp-onboarding-title {
    margin: 10px 0 8px;
    color: #fff;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -2.5px;
    text-transform: uppercase;
}

.jp-onboarding-subtitle {
    margin: 0;
    color: #858585;
    font-size: 16px;
    font-weight: 600;
}

.jp-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
}

.jp-progress-dot {
    width: 34px;
    height: 4px;
    border-radius: 99px;
    background: #292929;
    transition: .25s ease;
}

.jp-progress-dot.active { width: 58px; background: #ff3b30; box-shadow: 0 0 15px rgba(255, 59, 48, .75); }

.jp-panel { position: relative; padding: 24px 28px 30px; }
.jp-panel[hidden] { display: none; }

.jp-oopbuy-feature {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 22px;
    margin-bottom: 22px;
    border: 1px solid rgba(255, 59, 48, .5);
    border-radius: 26px;
    background: linear-gradient(100deg, rgba(255, 59, 48, .15), rgba(255, 59, 48, .035));
    box-shadow: inset 0 0 30px rgba(255, 59, 48, .05);
    outline: none;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.jp-oopbuy-feature:hover,
.jp-oopbuy-feature:focus-visible,
.jp-oopbuy-feature:focus-within {
    transform: translateY(-2px);
    border-color: #ff3b30;
    background: linear-gradient(100deg, rgba(255, 59, 48, .2), rgba(255, 59, 48, .055));
    box-shadow: inset 0 0 36px rgba(255, 59, 48, .08), 0 0 32px rgba(255, 59, 48, .14);
}

.jp-oopbuy-copy { display: flex; align-items: center; gap: 16px; min-width: 0; }
.jp-feature-icon,
.jp-agent-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #171717;
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}
.jp-feature-icon { width: 74px; height: 74px; border-radius: 21px; }
.jp-feature-icon img { width: 40px; height: 40px; border-radius: 9px; }
.jp-agent-icon { width: 48px; height: 48px; border-radius: 15px; }
.jp-agent-icon img { width: 28px; height: 28px; border-radius: 7px; }

.jp-recommended {
    display: inline-flex;
    margin-bottom: 6px;
    padding: 5px 10px;
    border-radius: 99px;
    color: #fff;
    background: #ff3b30;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.jp-oopbuy-copy h3 { margin: 0 0 5px; color: #fff; font-size: 27px; font-weight: 900; }
.jp-oopbuy-copy p { margin: 0; color: #a1a1a1; font-size: 13px; line-height: 1.55; }

.jp-oopbuy-bonuses { display: flex; gap: 12px; }
.jp-bonus {
    min-width: 126px;
    padding: 16px;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: rgba(0, 0, 0, .38);
    border: 1px solid rgba(255, 255, 255, .09);
}
.jp-bonus strong { display: block; font-size: 30px; font-weight: 900; line-height: 1; }
.jp-bonus span { display: block; margin-top: 7px; color: #ff6259; font-size: 10px; font-weight: 900; letter-spacing: .9px; text-transform: uppercase; }

.jp-register-nudge[hidden] { display: none !important; }
.jp-register-nudge {
    position: fixed;
    top: 50%;
    right: 20px;
    z-index: 4;
    width: 285px;
    min-height: 142px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 18px 14px;
    border: 1px solid rgba(255, 59, 48, .55);
    border-radius: 22px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(35, 8, 8, .98), rgba(7, 7, 7, .98));
    box-shadow: -16px 16px 55px rgba(0, 0, 0, .72), 0 0 30px rgba(255, 59, 48, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(calc(100% + 130px), -50%) scale(.96);
    transition: transform .34s cubic-bezier(.16, 1, .3, 1), opacity .22s ease, visibility .22s ease, border-color .28s ease, box-shadow .28s ease;
}
.jp-register-nudge.is-visible,
.jp-register-nudge:hover,
.jp-register-nudge:focus-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
    border-color: #ff3b30;
    box-shadow: -18px 18px 65px rgba(0, 0, 0, .82), 0 0 38px rgba(255, 59, 48, .28);
    outline: none;
}

.jp-register-curve {
    position: absolute;
    top: calc(100% - 8px);
    left: -169px;
    z-index: 3;
    width: 180px;
    height: 90px;
    opacity: 0;
    pointer-events: none;
    transform: translate(16px, -50%) scale(.94);
    transform-origin: right center;
    filter: drop-shadow(0 0 7px rgba(255, 59, 48, .72));
    transition: opacity .2s ease .08s, transform .35s cubic-bezier(.16, 1, .3, 1) .04s;
}
.jp-register-nudge.is-visible .jp-register-curve,
.jp-register-nudge:focus-visible .jp-register-curve {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
}
.jp-register-curve svg { display: block; width: 100%; height: 100%; overflow: visible; }
.jp-register-curve path {
    fill: none;
    stroke: #ff3b30;
    stroke-width: 3.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.jp-register-curve-line {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
}
.jp-register-nudge.is-visible .jp-register-curve-head {
    animation: jp-register-arrow-beat 1.3s ease-in-out .25s infinite;
}
.jp-register-copy { display: block; min-width: 0; }
.jp-register-copy small {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 99px;
    color: #fff;
    background: #ff3b30;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.jp-register-copy strong { display: block; margin-top: 10px; font-size: 16px; line-height: 1.2; }
.jp-register-copy > span { display: block; margin-top: 5px; color: #979797; font-size: 10px; font-weight: 650; line-height: 1.45; }
.jp-register-copy b { display: block; margin-top: 10px; color: #ff5147; font-size: 10px; letter-spacing: .7px; }
@keyframes jp-register-pulse {
    0%, 100% { transform: translateX(0); opacity: .8; }
    50% { transform: translateX(-6px); opacity: 1; }
}

@keyframes jp-register-arrow-beat {
    0%, 100% { transform: translateX(0); opacity: .86; }
    50% { transform: translateX(-4px); opacity: 1; }
}

@media (min-width: 1540px) {
    .jp-register-nudge { right: 24px; }
}

.jp-section-label { margin: 0 0 12px; color: #777; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; text-align: center; text-transform: uppercase; }

.jp-agent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.jp-agent-card {
    position: relative;
    min-width: 0;
    padding: 16px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 21px;
    color: #fff;
    background: linear-gradient(145deg, #151515, #0c0c0c);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.jp-agent-card:hover { transform: translateY(-2px); border-color: rgba(255, 59, 48, .5); }
.jp-agent-card.selected { border-color: #ff3b30; background: linear-gradient(145deg, rgba(255, 59, 48, .2), #0c0c0c); box-shadow: 0 0 22px rgba(255, 59, 48, .13); }
.jp-agent-card .jp-check {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #ff3b30;
    opacity: 0;
}
.jp-agent-card.selected .jp-check { opacity: 1; }
.jp-agent-card strong { display: block; margin-top: 12px; font-size: 15px; }
.jp-agent-card small { display: block; margin-top: 4px; color: #777; font-size: 10px; font-weight: 700; }
.jp-agent-card[data-agent="oopbuy"]::after {
    content: "RECOMMENDED";
    position: absolute;
    top: -8px;
    left: 14px;
    padding: 4px 8px;
    border-radius: 99px;
    color: #fff;
    background: #ff3b30;
    font-size: 8px;
    font-weight: 900;
}

.jp-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; max-width: 840px; margin: 12px auto 20px; }
.jp-choice-card {
    min-height: 100px;
    display: grid;
    place-items: center;
    gap: 7px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 20px;
    color: #fff;
    background: #111;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: .2s ease;
}
.jp-choice-card i { color: #666; font-size: 22px; }
.jp-currency-flag {
    display: block;
    width: 40px;
    height: 27px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .35);
    filter: saturate(.9);
    transition: transform .2s ease, filter .2s ease;
}
.jp-choice-card:hover .jp-currency-flag,
.jp-choice-card.selected .jp-currency-flag { transform: scale(1.08); filter: saturate(1.15); }
.jp-choice-card:hover,
.jp-choice-card.selected { border-color: #ff3b30; background: rgba(255, 59, 48, .1); box-shadow: 0 0 20px rgba(255, 59, 48, .1); }
.jp-choice-card.selected i { color: #ff3b30; }
.jp-choice-card small { color: #777; font-size: 10px; font-weight: 600; }

.jp-theme-grid { grid-template-columns: repeat(2, minmax(0, 280px)); justify-content: center; }
.jp-theme-preview { width: 100%; height: 58px; padding: 9px; border-radius: 12px; border: 1px solid #333; }
.jp-theme-preview.dark { background: #050505; }
.jp-theme-preview.light { background: #f5f5f5; }
.jp-theme-preview::before,
.jp-theme-preview::after { content: ""; display: block; height: 10px; margin-bottom: 7px; border-radius: 4px; background: #ff3b30; }
.jp-theme-preview::after { width: 65%; background: #777; }

.jp-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.jp-btn {
    min-width: 150px;
    padding: 15px 22px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    color: #aaa;
    background: #151515;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: pointer;
}
.jp-btn-primary { color: #fff; border-color: #ff3b30; background: #ff3b30; box-shadow: 0 8px 25px rgba(255, 59, 48, .28); }
.jp-btn-primary:hover { background: #e6332a; transform: translateY(-1px); }

.stg-tabs.pref-agent-enabled { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jp-settings-agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.jp-settings-agent {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border: 1px solid #222;
    border-radius: 14px;
    color: #aaa;
    background: #111;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}
.jp-settings-agent img { width: 22px; height: 22px; border-radius: 5px; }
.jp-settings-agent.selected { color: #fff; border-color: #ff3b30; background: rgba(255, 59, 48, .09); }

@media (max-width: 820px) {
    .jp-onboarding { padding: 12px; }
    .jp-onboarding-dialog { max-height: calc(100vh - 24px); border-radius: 24px; }
    .jp-onboarding-head { padding: 34px 55px 23px; }
    .jp-onboarding-title { letter-spacing: -1.5px; }
    .jp-panel { padding: 18px; }
    .jp-oopbuy-feature { grid-template-columns: 1fr; }
    .jp-oopbuy-bonuses { width: 100%; }
    .jp-bonus { flex: 1; min-width: 0; }
    .jp-agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jp-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jp-register-nudge { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .jp-oopbuy-feature,
    .jp-register-nudge,
    .jp-register-curve { transition: none !important; }
    .jp-register-curve-line,
    .jp-register-curve-head { animation: none !important; }
}

@media (max-width: 480px) {
    .jp-onboarding-head { padding: 27px 48px 20px; }
    .jp-onboarding-title { font-size: 30px; }
    .jp-onboarding-subtitle { font-size: 12px; }
    .jp-onboarding-close { top: 15px; right: 15px; width: 38px; height: 38px; font-size: 20px; }
    .jp-feature-icon { width: 58px; height: 58px; }
    .jp-oopbuy-copy h3 { font-size: 21px; }
    .jp-bonus strong { font-size: 23px; }
    .jp-agent-card { padding: 14px 12px; }
    .jp-actions { position: sticky; bottom: -18px; padding: 12px 0 0; background: linear-gradient(transparent, #080808 26%); }
    .jp-btn { min-width: 0; flex: 1; }
}

/* Keep the dialog independently scrollable while the page behind it is locked. */
.jp-onboarding-dialog {
    max-height: min(900px, calc(100dvh - 48px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,59,48,.8) rgba(255,255,255,.04);
    background: radial-gradient(circle at 15% 0%,rgba(255,59,48,.09),transparent 35%),linear-gradient(145deg,#151112,#080808 70%);
    border-color: rgba(255,80,70,.36);
    box-shadow: 0 32px 100px rgba(0,0,0,.8),0 0 48px rgba(255,59,48,.12),inset 0 1px rgba(255,255,255,.06);
}
.jp-onboarding-dialog::-webkit-scrollbar { width: 7px; }
.jp-onboarding-dialog::-webkit-scrollbar-track { background: transparent; }
.jp-onboarding-dialog::-webkit-scrollbar-thumb { background: rgba(255,59,48,.75); border-radius: 10px; }
.jp-onboarding-head { background: linear-gradient(180deg,rgba(255,255,255,.025),transparent); }
.jp-onboarding-title { text-shadow: 0 8px 35px rgba(255,59,48,.18); }
.jp-agent-card,.jp-choice-card { box-shadow: inset 0 1px rgba(255,255,255,.045),0 10px 24px rgba(0,0,0,.18); }
.jp-agent-card:focus-visible,.jp-choice-card:focus-visible,.jp-btn:focus-visible,.jp-onboarding-close:focus-visible { outline: 2px solid #ff766e; outline-offset: 3px; }
.jp-agent-card.selected,.jp-choice-card.selected { box-shadow: inset 0 1px rgba(255,255,255,.08),0 0 24px rgba(255,59,48,.16); }
.jp-btn { transition: transform .2s ease,background .2s ease,box-shadow .2s ease; }
.jp-btn:hover { transform: translateY(-2px); }
@keyframes jpWelcomeIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes jpWelcomePanel { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
    .jp-onboarding:not([hidden]) .jp-onboarding-dialog { animation: jpWelcomeIn .45s cubic-bezier(.16,1,.3,1) both; }
    .jp-panel:not([hidden]) { animation: jpWelcomePanel .3s ease-out both; }
}
@media (max-width: 820px) { .jp-onboarding-dialog { max-height: calc(100dvh - 24px); } }
@media (prefers-reduced-motion: reduce) {
    .jp-onboarding-dialog,.jp-panel,.jp-agent-card,.jp-choice-card,.jp-btn { animation: none !important; transition: none !important; }
}
