.rascal-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    pointer-events: none;
}
.rascal-overlay[hidden] { display: none; }

.rascal-catch {
    position: fixed;
    inset: 0;
    pointer-events: auto;
    background: transparent;
}

.rascal-spot {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(26, 24, 22, 0.72);
    outline: 3px solid var(--boh-gold, #C4A46A);
    outline-offset: 4px;
    transition: top .38s cubic-bezier(.4, 0, .2, 1),
                left .38s cubic-bezier(.4, 0, .2, 1),
                width .38s cubic-bezier(.4, 0, .2, 1),
                height .38s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
}

.rascal-spot--none {
    box-shadow: 0 0 0 9999px rgba(26, 24, 22, 0.80);
    outline-color: transparent;
}

.rascal-coach {
    position: absolute;
    top: 0; left: 0;
    z-index: 2;
    pointer-events: none;
    max-width: 340px;
}

.rascal-guide {
    position: absolute;
    left: -120px;
    bottom: -10px;
    width: 138px;
    z-index: 2;                 
    pointer-events: none;
    transform-origin: bottom center;   
}
.rascal-guide-img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .38));
    animation: rascal-pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

.rascal-bubble {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    background: var(--boh-bg-cream, #FFFDF9);
    color: var(--boh-text-body, #2C2A26);
    border: 1px solid var(--boh-border-strong, rgba(60, 50, 40, .28));
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 14px 38px rgba(26, 24, 22, .34);
    animation: rascal-pop .42s cubic-bezier(.34, 1.56, .64, 1) both;
}

.rascal-bubble__name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 3px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--boh-blue, #3A6B8A);
}

.rascal-bubble__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}
.rascal-ctrl-spacer { flex: 1 1 auto; }

.rascal-bubble__title {
    margin: 0 0 6px;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--boh-text-heading, #1A1816);
    text-wrap: balance;
}
.rascal-bubble__text {
    margin: 0 0 12px;
    font-size: .95rem;
    line-height: 1.5;
    overflow-y: auto;          
    min-height: 0;
    overscroll-behavior: contain;
}
.rascal-bubble__controls,
.rascal-bubble__name,
.rascal-bubble__title,
.rascal-dots { flex: 0 0 auto; }

.rascal-dots { display: flex; gap: 5px; }
.rascal-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--boh-border-strong, rgba(60, 50, 40, .28));
    transition: background .2s, transform .2s;
}
.rascal-dot--on {
    background: var(--boh-blue, #3A6B8A);
    transform: scale(1.15);
}

.rascal-btn {
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1;
    width: auto;                
    border-radius: 9px;
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}
.rascal-btn--next {
    background: var(--boh-blue, #3A6B8A);
    color: var(--boh-text-on-accent, #fff);
}
.rascal-btn--next:hover { background: var(--boh-blue-dark, #2a4f6a); }
.rascal-btn--back {
    background: transparent;
    color: var(--boh-text-muted, #7A7368);
    border-color: var(--boh-border, rgba(60, 50, 40, .15));
    padding: 8px 12px;
}
.rascal-btn--back:hover { background: var(--boh-bg-light, #f0ece6); }

.rascal-skip {
    padding: 6px 8px;
    background: none;
    border: none;
    font: inherit;
    font-size: .82rem;
    color: var(--boh-text-subtle, #9a9390);
    cursor: pointer;
    pointer-events: auto;
}
.rascal-skip:hover { color: var(--boh-text-muted, #7A7368); }

.rascal-btn:focus-visible,
.rascal-skip:focus-visible,
.rascal-summon:focus-visible {
    outline: 3px solid var(--boh-gold, #C4A46A);
    outline-offset: 2px;
}

.rascal-summon {
    position: fixed;
    right: 22px;
    bottom: 0;
    z-index: 19000;
    width: 112px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
    overflow: visible;
    transform: translateY(0%);            
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1),
                width .22s cubic-bezier(.34, 1.56, .64, 1);
}

.rascal-summon--standing,
.rascal-summon--standing:hover,
.rascal-summon--standing:focus-visible {
    width: 132px;
    transform: translateY(1%);            
}
.rascal-summon--standing img {
    filter: drop-shadow(0 6px 10px rgba(26, 24, 22, .32));  
}
.rascal-summon img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 -3px 8px rgba(26, 24, 22, .28));
}
.rascal-summon__tip {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    background: var(--boh-bg-dark, #2b2f34);
    color: var(--boh-text-on-dark, #fdfcfa);
    font-size: .8rem;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.rascal-summon:hover .rascal-summon__tip,
.rascal-summon:focus-visible .rascal-summon__tip { opacity: 1; }

.rascal-summon--wave { animation: rascal-peek 2.4s ease-in-out 1; }

@keyframes rascal-pop {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes rascal-peek {
    0%   { transform: translateY(0%); }
    35%  { transform: translateY(-16%); }
    70%  { transform: translateY(0%); }
    100% { transform: translateY(0%); }
}

@media (max-width: 640px) {
    .rascal-coach {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto !important;
        max-width: none;
        display: flex;
        align-items: flex-end;
        gap: 0;
    }
    .rascal-guide {
        position: static;
        left: auto;
        bottom: auto;
        width: 74px;
        min-width: 74px;
        margin: 0 -6px -2px 0;      
    }
    .rascal-coach--top {
        top: 8px !important;
        bottom: auto !important;
    }
    .rascal-bubble {
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;
        max-height: 60vh;
        overflow-y: auto;
        box-shadow: 0 -6px 30px rgba(26, 24, 22, .30), 0 14px 38px rgba(26, 24, 22, .34);
    }
    .rascal-summon {
        right: 10px;
        width: 92px;
        transform: translateY(0%);
    }
    .rascal-summon:hover,
    .rascal-summon:focus-visible { transform: translateY(-6%); }
}

@media (prefers-reduced-motion: reduce) {
    .rascal-spot { transition: none; }
    .rascal-bubble,
    .rascal-guide-img { animation: none; }
    .rascal-summon,
    .rascal-summon--wave { transition: none; animation: none; }
}
