/* =========================================
   GR 2.0 onboarding tour — onboarding.css
   Dimmed page with a gold-ringed spotlight on the target, a curved gold
   arrow, and the tour card (dark glass, gold edge, icon tile, dots, ›),
   as in references/Menu_and_Tutorial.jfif. Driven by js/onboarding.js.
   ========================================= */
/* Page can't scroll while the tour is up (js also blocks wheel/touch/keys);
   the tour still scrolls to each target itself. The gutter stays so the
   page doesn't shift when the scrollbar goes. */
html.onb-lock {
    overflow: hidden !important;     /* html only: body is height:100%, hiding its overflow would cut the page */
    overscroll-behavior: none;
    scrollbar-gutter: stable;
}
.onb-card { overscroll-behavior: contain; }

.onb {
    position: fixed;
    inset: 0;
    z-index: 100000;          /* above the header, menus, bell, modals and banners */
    pointer-events: none;
    font-family: inherit;
}

/* Spotlight: the hole's huge shadow dims everything around it */
.onb-hole {
    position: fixed;
    border-radius: 14px;
    box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.74);
    transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease, border-radius .28s ease;
    pointer-events: none;
}
.onb-hole.is-ring {
    box-shadow:
        0 0 0 200vmax rgba(0, 0, 0, 0.74),
        0 0 0 2px rgba(235, 207, 129, 0.95),
        0 0 26px 6px rgba(235, 207, 129, 0.45);
    animation: onb-glow 2.2s ease-in-out infinite;
}
@keyframes onb-glow {
    0%, 100% { box-shadow: 0 0 0 200vmax rgba(0,0,0,.74), 0 0 0 2px rgba(235,207,129,.95), 0 0 22px 4px rgba(235,207,129,.38); }
    50%      { box-shadow: 0 0 0 200vmax rgba(0,0,0,.74), 0 0 0 2px rgba(235,207,129,1),   0 0 34px 9px rgba(235,207,129,.55); }
}

/* Invisible covers around the hole: only the highlighted thing can be used */
.onb-block {
    position: fixed;
    pointer-events: auto;
    background: transparent;
}

/* Curved arrow */
.onb-arrow {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(235, 207, 129, 0.55));
}
.onb-arrow__path {
    fill: none;
    stroke: #EBCF81;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-dasharray: 7 6;
    animation: onb-dash 1.1s linear infinite;
}
@keyframes onb-dash { to { stroke-dashoffset: -26; } }

/* Gold pulse where the browser's own button is (install step) */
.onb-ping {
    position: fixed;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: #EBCF81;
    box-shadow: 0 0 0 0 rgba(235, 207, 129, 0.7);
    animation: onb-ping 1.4s ease-out infinite;
}
@keyframes onb-ping {
    0%   { box-shadow: 0 0 0 0 rgba(235, 207, 129, 0.7); }
    100% { box-shadow: 0 0 0 22px rgba(235, 207, 129, 0); }
}

/* ── Card ─────────────────────────────────────────────── */
.onb-card {
    position: fixed;
    pointer-events: auto;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    padding: 20px 20px 16px;
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.86);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(235, 207, 129, 0.20) 0%, rgba(235, 207, 129, 0) 60%),
        linear-gradient(160deg, rgba(40, 31, 16, 0.96) 0%, rgba(12, 10, 8, 0.97) 70%);
    border: 1px solid rgba(235, 207, 129, 0.75);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(235, 207, 129, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    transition: left .28s ease, top .28s ease;
}
.onb.is-in .onb-card { animation: onb-in .32s ease both; }
@keyframes onb-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.onb-card__top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "icon title close"
        "icon body  body";
    column-gap: 16px;
    align-items: start;
}
/* Long cards (install steps, upgrade): the text runs full width under the icon */
.onb-card--wide .onb-card__top {
    grid-template-areas:
        "icon title close"
        "body body  body";
    align-items: center;
}
.onb-card--wide .onb-card__body { margin-top: 12px; }
.onb-card__icon {
    grid-area: icon;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #EBCF81;
    background: linear-gradient(160deg, rgba(235, 207, 129, 0.16), rgba(235, 207, 129, 0.04));
    border: 1.5px solid rgba(235, 207, 129, 0.8);
    box-shadow: 0 0 16px rgba(235, 207, 129, 0.25), inset 0 0 12px rgba(235, 207, 129, 0.12);
}
.onb-card__title {
    grid-area: title;
    margin: 2px 0 6px;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
    color: #EBCF81;
}
.onb-card--wide .onb-card__title { margin: 0; }
.onb-card__body {
    grid-area: body;
    min-width: 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.84);
}
.onb-card__body b { color: #fff; font-weight: 600; }
.onb-card__close {
    grid-area: close;
    width: 34px;
    height: 34px;
    margin: -6px -6px 0 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.onb-card__close:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* "Tap the highlighted …" */
.onb-card__hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    color: #EBCF81;
    background: rgba(235, 207, 129, 0.08);
    border: 1px dashed rgba(235, 207, 129, 0.4);
}
.onb-card__hint i { font-size: 18px; animation: onb-tap 1.2s ease-in-out infinite; }
@keyframes onb-tap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Install steps */
.onb-steps {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: onb;
}
.onb-steps li {
    position: relative;
    padding: 6px 0 6px 34px;
    font-size: 15px;
    line-height: 1.45;
    counter-increment: onb;
}
.onb-steps li::before {
    content: counter(onb);
    position: absolute;
    left: 0;
    top: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    color: #14110F;
    background: linear-gradient(135deg, #CFAF67, #EBCF81);
}
.onb-steps i, .onb-note i { color: #EBCF81; }
.onb-note {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
.onb-card__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.onb-btn {
    flex: 1 1 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.onb-btn--gold {
    border: 0;
    color: #14110F;
    background: linear-gradient(135deg, #CFAF67 0%, #EBCF81 100%);
}
.onb-btn--gold:hover { box-shadow: 0 8px 24px rgba(235, 207, 129, 0.3); transform: translateY(-1px); }
.onb-btn--ghost {
    color: #EBCF81;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(235, 207, 129, 0.5);
}
.onb-btn--ghost:hover { border-color: #EBCF81; background: rgba(235, 207, 129, 0.08); }
.onb-btn--link {
    flex-basis: 100%;
    min-height: 0;
    padding: 4px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    font-size: 14px;
    text-decoration: underline;
}

/* Dots + › */
.onb-card__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 54px;
    margin-top: 10px;
}
.onb-dots {
    display: flex;
    gap: 10px;
}
.onb-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}
.onb-dot.is-on {
    background: #EBCF81;
    box-shadow: 0 0 8px rgba(235, 207, 129, 0.8);
}
.onb-card__next {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1.5px solid #EBCF81;
    background: rgba(235, 207, 129, 0.06);
    color: #EBCF81;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(235, 207, 129, 0.25);
    transition: background .2s ease, box-shadow .2s ease;
}
.onb-card__next:hover { background: rgba(235, 207, 129, 0.16); box-shadow: 0 0 22px rgba(235, 207, 129, 0.45); }

@media (max-width: 380px) {
    .onb-card { padding: 16px 16px 12px; }
    .onb-card__icon { width: 48px; height: 48px; font-size: 25px; border-radius: 14px; }
    .onb-card__title { font-size: 19px; }
    .onb-card__body, .onb-steps li { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .onb-hole, .onb-card { transition: none; }
    .onb-hole.is-ring, .onb-arrow__path, .onb-ping, .onb-card__hint i, .onb.is-in .onb-card { animation: none; }
}
