/* ========================================================
   iPhone 16 preview shell (desktop only, >=700px)
   Created by iphone_shell.js; on mobile it is display:contents (no frame).
   ======================================================== */
@media (min-width: 700px) {
    html:has(#iphone16-shell) {
        height: 100%;
        overflow: hidden !important;
        display: block !important;
        background: radial-gradient(ellipse at 50% 7%, #f8f9ff 0%, #dce6f7 55%, #c9d7ed 100%) !important;
    }
    body:has(#iphone16-shell) {
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 100dvh !important;
        height: 100dvh !important;
        padding: 12px !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: radial-gradient(ellipse at 50% 7%, #f8f9ff 0%, #dce6f7 55%, #c9d7ed 100%) !important;
        background-attachment: scroll !important;
    }
    #iphone16-shell {
        --phone-radius: 55px;
        position: relative;
        box-sizing: border-box;
        width: auto !important;
        height: min(906px, calc(100dvh - 24px)) !important;
        aspect-ratio: 402 / 874;
        flex: 0 0 auto;
        padding: 11px;
        border-radius: var(--phone-radius);
        border: 2px solid #4a5358;
        background: linear-gradient(120deg, #050607 0%, #303b3e 10%, #090c0e 27%, #293237 73%, #0b0f10 100%);
        transform: translateZ(0);
        box-shadow: 0 2px 0 2px #8d989e, 0 0 0 4px #283137,
            0 18px 55px rgba(35, 47, 69, .27), 0 25px 90px rgba(25, 33, 54, .18),
            inset 0 0 3px 2px #8d989d;
    }
    #iphone16-shell:before, #iphone16-shell:after {
        content: "";
        position: absolute;
        z-index: 0;
        width: 3px;
        border-radius: 3px 0 0 3px;
        background: linear-gradient(90deg, #59646b, #20282c);
        left: -6px;
    }
    #iphone16-shell:before { top: 21%; height: 8%; }
    #iphone16-shell:after { top: 33%; height: 12%; }
    #iphone16-power {
        position: absolute; right: -6px; top: 31%; height: 12%; width: 3px;
        border-radius: 0 3px 3px 0;
        background: linear-gradient(90deg, #232a2f, #616a6f);
    }
    #iphone16-shell #app,
    #iphone16-shell > .risk-rush-app-container,
    #iphone16-shell > .container {
        position: relative !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding-top: 40px !important;
        border-radius: 43px !important;
        box-shadow: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    #iphone16-shell #app.container-index {
        background-color: #581a38 !important;
        background-origin: content-box !important;
        background-clip: padding-box !important;
    }
    #iphone16-shell #app.container-home-2026:not(.container-index) { background-color: #4b092c !important; }
    /* Sub pages: bg_all.jpg lives on the app itself (the fixed ::before would escape the phone). */
    #iphone16-shell #app.container-home-2026:not(.is-home-page):not(.is-login-page)::before { display: none !important; }
    #iphone16-shell #app.container-home-2026:not(.is-home-page):not(.is-login-page) {
        background-color: #3a0b28 !important;
        background-image: url('assets/img/bg_all.jpg') !important;
        background-repeat: no-repeat !important;
        background-size: cover !important;
        background-position: top center !important;
        background-origin: content-box !important;
        background-clip: padding-box !important;
        background-attachment: scroll !important;
    }
    #iphone16-shell > .risk-rush-app-container,
    #iphone16-shell > .container {
        padding-top: 40px !important;
        box-sizing: border-box !important;
    }
    /* Overlays moved into the phone */
    #iphone16-shell > .rb36-dimmer,
    #iphone16-shell > .modal-engage {
        position: absolute !important;
        inset: 0 !important;
        width: auto !important;
        height: auto !important;
        border-radius: var(--phone-radius);
        z-index: 8800 !important;
    }
    #iphone16-shell .privacy-banner-2026 { padding-bottom: 22px !important; }
    #iphone16-shell .iphone-status {
        display: flex; pointer-events: none; position: absolute; z-index: 9000;
        align-items: center; justify-content: space-between;
        top: 16px; left: 44px; right: 42px; height: 25px;
        font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
        font-size: 12px; font-weight: 750; color: #fff;
        text-shadow: 0 1px 3px #26081aaa;
    }
    #iphone16-shell .iphone-indicators { display: flex; align-items: center; gap: 5px; }
    #iphone16-shell .iphone-indicators svg { height: 13px; width: auto; }
    #iphone16-shell .iphone-island {
        position: absolute; pointer-events: none; z-index: 9001; top: 14px; left: 50%;
        transform: translateX(-50%); width: 106px; height: 30px; border-radius: 28px;
        background: #030306; box-shadow: inset 0 0 0 1px #202027, 0 1px 3px #13101999;
    }
    #iphone16-shell .iphone-island:after {
        content: ""; position: absolute; top: 10px; right: 13px; width: 9px; height: 9px;
        border-radius: 50%; background: radial-gradient(circle at 30% 30%, #172036, #03050a 70%);
    }
    #iphone16-shell .iphone-home-indicator {
        position: absolute; pointer-events: none; z-index: 9002; bottom: 18px; left: 50%;
        transform: translateX(-50%); width: 108px; height: 4px; border-radius: 999px;
        background: #e3e9ee; box-shadow: 0 0 5px #0008;
    }
}
@media (min-width: 700px) {
    /* No scrollbars inside the phone display */
    #iphone16-shell, #iphone16-shell * { scrollbar-width: none !important; -ms-overflow-style: none !important; }
    #iphone16-shell *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
}
@media (max-width: 699px) {
    #iphone16-shell { display: contents; }
    #iphone16-shell .iphone-status, #iphone16-shell .iphone-island,
    #iphone16-shell .iphone-home-indicator, #iphone16-power { display: none !important; }
}

/* ========================================================
   Mascot dock - anchored to the visible phone display
   ======================================================== */
#rbMascotDock {
    position: absolute;
    z-index: 8500;
    box-sizing: border-box;
    width: clamp(150px, 18svh, 190px);
    aspect-ratio: 403 / 424;
    right: 12px;
    bottom: clamp(48px, 6.7%, 72px);
    overflow: visible;
    -webkit-clip-path: inset(-30px 0 0 0);
    clip-path: inset(-30px 0 0 0); /* clips the half-hidden right side */
    pointer-events: none; /* the big transparent box must never swallow clicks (e.g. the Submit button) */
    -webkit-tap-highlight-color: transparent;
}
#rbMascotDock #virtualAssistant,
#rbMascotDock #virtualAssistant.show {
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important; top: 0 !important; right: auto !important; bottom: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    display: block !important;
    transform: translate3d(49%, 0, 0) !important;
    filter: drop-shadow(0 4px 5px rgba(18, 0, 15, .22)) !important;
    transition: transform .35s cubic-bezier(.22, .79, .25, 1) !important;
}
#rbMascotDock:is(:hover, :focus-within) #virtualAssistant.show,
#rbMascotDock #virtualAssistant.peek-full,
#rbMascotDock #virtualAssistant:hover,
#rbMascotDock #virtualAssistant:active {
    transform: translate3d(0, 0, 0) !important;
}
#rbMascotDock #virtualAssistant { pointer-events: none !important; }
#rbMascotDock #virtualAssistant .va-mascot-inner,
#rbMascotDock #virtualAssistant .va-mascot-img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    pointer-events: none !important;
}
/* Only the bear itself is clickable/hoverable (clip-path also clips hit-testing) */
#rbMascotDock #virtualAssistant .va-mascot-img {
    pointer-events: auto !important;
    clip-path: inset(14% 24% 10% 24%);
    cursor: pointer;
}
/* Real phones: the shell is display:contents, so pin the dock to the viewport */
@media (max-width: 699px) {
    #rbMascotDock {
        position: fixed;
        right: 0;
        bottom: clamp(48px, 7dvh, 72px);
        width: clamp(112px, 34vw, 150px);
    }
}
