/* =====================================================
   BUYER GUIDED TOUR — public/js/guided-tour.js
   A spotlight on the part being explained and the guide's card beside it.
   Themes: GoMate (shop red), GoCoins (gold), GoArcade (casino dark).
===================================================== */
.bt-root {
    --bt-accent: #d0001b;
    --bt-accent-2: #a80016;
    --bt-card: #ffffff;
    --bt-ink: #1f2937;
    --bt-muted: #6b7280;
    --bt-bubble: #fdf3f4;
    --bt-line: #f1e3e5;
    --bt-btn-ink: #ffffff;
    position: fixed;
    inset: 0;
    z-index: 10050;
    opacity: 0;
    transition: opacity .25s ease;
    font-family: inherit;
}

.bt-root.is-open { opacity: 1; }

.bt-theme-gocoins {
    --bt-accent: #c8921f;
    --bt-accent-2: #7a1018;
    --bt-bubble: #fdf8ec;
    --bt-line: #f3e6c8;
    --bt-btn-ink: #3b0a14;
}

.bt-theme-goarcade {
    --bt-accent: #f5c451;
    --bt-accent-2: #c8921f;
    --bt-card: #1d0a10;
    --bt-ink: #f6ead7;
    --bt-muted: #b9a28f;
    --bt-bubble: rgba(255, 255, 255, .05);
    --bt-line: rgba(245, 196, 81, .2);
    --bt-btn-ink: #3b0a14;
}

/* Clicks on the page wait until the tour is done. */
.bt-shade {
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background .3s;
}

.bt-root.is-center .bt-shade { background: rgba(8, 3, 5, .66); }

.bt-spot {
    position: fixed;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(8, 3, 5, .66);
    outline: 2px solid var(--bt-accent);
    outline-offset: 0;
    pointer-events: none;
    transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, opacity .25s;
    animation: btRing 1.8s ease-in-out infinite;
}

@keyframes btRing {
    50% { outline-offset: 4px; outline-color: rgba(255, 255, 255, .85); }
}

/* ------------------------------------------------------------ the card */
.bt-card {
    position: fixed;
    width: min(380px, calc(100vw - 24px));
    padding: 0 0 16px;
    border-radius: 20px;
    background: var(--bt-card);
    color: var(--bt-ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35), 0 0 0 1px var(--bt-line);
    transition: left .35s ease, top .35s ease, opacity .2s, transform .2s;
}

.bt-card.is-moving { opacity: .55; transform: scale(.98); }

/* The bubble's pointer toward the spotlight. */
.bt-card::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--bt-card);
    box-shadow: -1px -1px 0 var(--bt-line);
    transform: rotate(45deg);
}

.bt-card[data-place="bottom"]::before { top: -8px; left: calc(var(--arrow, 50%) - 8px); }
.bt-card[data-place="top"]::before { bottom: -8px; left: calc(var(--arrow, 50%) - 8px); transform: rotate(225deg); }
.bt-card[data-place="right"]::before { left: -8px; top: calc(var(--arrow, 50%) - 8px); transform: rotate(-45deg); }
.bt-card[data-place="left"]::before { right: -8px; top: calc(var(--arrow, 50%) - 8px); transform: rotate(135deg); }
.bt-card[data-place="center"]::before, .bt-card[data-place="over"]::before { display: none; }

.bt-mascot {
    position: absolute;
    left: 10px;
    top: -42px;
    height: 104px;
    width: auto;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3));
    animation: btBob 2.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btBob {
    50% { transform: translateY(-5px); }
}

.bt-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 12px 12px 6px 104px;
}

.bt-who { flex: 1; min-width: 0; }
.bt-who b { display: block; font-size: 16px; font-weight: 900; color: var(--bt-ink); }
.bt-who small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bt-muted); }
.bt-who small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

.bt-x {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bt-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bt-x:hover { background: var(--bt-bubble); color: var(--bt-ink); }

.bt-bubble {
    position: relative;
    margin: 8px 16px 0;
    padding: 14px 16px 15px;
    border-radius: 4px 16px 16px 16px;
    background: var(--bt-bubble);
    border: 1px solid var(--bt-line);
    min-height: 92px;
}

.bt-count {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--bt-accent);
}

.bt-theme-gocoins .bt-count { color: #9a6b0f; }

.bt-bubble h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; line-height: 1.3; color: var(--bt-ink); }
.bt-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--bt-ink); opacity: .86; }

/* "GoMate is typing…" for a beat before each message. */
.bt-typing { display: none; gap: 4px; padding: 4px 0; }
.bt-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--bt-muted); animation: btDot 1s infinite; }
.bt-typing i:nth-child(2) { animation-delay: .15s; }
.bt-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes btDot { 30% { transform: translateY(-4px); opacity: 1; } 0%, 60%, 100% { opacity: .4; } }
.bt-root.is-typing .bt-typing { display: flex; }
.bt-root.is-typing .bt-text { display: none; }
.bt-text { animation: btFade .3s ease; }
@keyframes btFade { from { opacity: 0; transform: translateY(4px); } }

.bt-progress {
    height: 4px;
    margin: 14px 16px 0;
    border-radius: 9px;
    background: var(--bt-line);
    overflow: hidden;
}

.bt-progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 9px;
    background: linear-gradient(90deg, var(--bt-accent), var(--bt-accent-2));
    transition: width .35s ease;
}

.bt-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 16px 0;
}

.bt-skip {
    padding: 8px 4px;
    border: 0;
    background: none;
    color: var(--bt-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.bt-skip:hover { color: var(--bt-ink); text-decoration: underline; }
.bt-nav { display: flex; gap: 8px; margin-left: auto; }

.bt-back, .bt-next {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .1s, filter .15s, background .15s;
}

.bt-back {
    border: 1px solid var(--bt-line);
    background: transparent;
    color: var(--bt-ink);
}

.bt-back:hover { background: var(--bt-bubble); }

.bt-next {
    min-width: 92px;
    justify-content: center;
    border: 0;
    background: linear-gradient(180deg, var(--bt-accent), var(--bt-accent-2));
    color: var(--bt-btn-ink);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.bt-theme-gocoins .bt-next, .bt-theme-goarcade .bt-next { background: linear-gradient(180deg, #ffe7a3, #f5c451 45%, #c8921f); }
.bt-next:hover { filter: brightness(1.06); }
.bt-next:active { transform: translateY(1px); }
.bt-next:focus-visible, .bt-back:focus-visible, .bt-skip:focus-visible, .bt-x:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 2px; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 640px) {
    .bt-card { width: calc(100vw - 24px); }
    .bt-card::before { display: none; }
    .bt-mascot { height: 84px; top: -30px; }
    .bt-head { padding-left: 88px; min-height: 54px; }
    .bt-bubble { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bt-spot, .bt-mascot, .bt-typing i { animation: none; }
    .bt-card, .bt-spot { transition: none; }
}

/* ------------------------------------------------------------ dashboards' Guide pill */
.admin-guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid #f1d4d8;
    background: #fdf3f4;
    color: #b00018;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

.admin-guide-btn:hover { background: #fbe1e3; border-color: #e9b4bb; }

@media (max-width: 640px) {
    .admin-guide-btn span { display: none; }
}
