/* client-mascot.css
 * Shared mascot. Positioning mode belongs to each variant — base only defines
 * shared traits (size, pointer-events). Sizing ladder mirrors
 * client-feed-wheel.js:89–95 thresholds.
 */

.client-mascot {
    width: min(200px, 30vh);
    pointer-events: none;
}

.client-mascot img {
    width: 100%;
    height: auto;
    display: block;
}

/* Narrow viewport or short height (landscape phones): matches JS vh < 600 branch */
@media (max-width: 519.98px),
(max-height: 599.98px) {
    .client-mascot {
        width: min(190px, 30vh);
    }
}

@media (max-width: 419.98px) {
    .client-mascot {
        width: min(180px, 30vh);
    }
}

@media (max-width: 359.98px) {
    .client-mascot {
        width: min(160px, 30vh);
    }
}

/* ── Per-page variants ─────────────────────────────────────── */

.client-mascot--feed {
    position: absolute;
    z-index: 200;
    left: 8px;
    /* top is written inline by client-feed-wheel.js (wheel-anchored math) */
}

@media (min-width: 520px) {
    .client-mascot--feed {
        left: 16px;
    }
}

.client-mascot--progress {
    position: relative;
    margin: 0 auto 16px;
}

.client-mascot--zen {
    position: relative;
    margin: 0 auto 20px;
}

.client-mascot--training {
    position: relative;
    margin: 16px auto 24px;
}

/* ── Caption bubble ──────────────────────────────────────── */

.client-mascot__bubble {
    position: absolute;
    top: 18%;
    left: calc(100% - 24px);
    max-width: 180px;
    min-width: 80px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.25;
    text-align: center;
    opacity: 0;
    transform: translateX(-6px);
    pointer-events: none;
    white-space: normal;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 1;
}

.client-mascot__bubble::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -7px;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 7px 8px 7px 0;
    border-color: transparent rgba(0, 0, 0, 0.85) transparent transparent;
}

.client-mascot__bubble.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Tighten max-width on very narrow viewports so the bubble doesn't run off-screen */
@media (max-width: 419.98px) {
    .client-mascot__bubble {
        max-width: 150px;
        font-size: 0.8rem;
    }
}

@media (max-width: 359.98px) {
    .client-mascot__bubble {
        max-width: 130px;
        padding: 6px 10px;
    }
}

/* ── Reacting micro-animation ────────────────────────────── */

.client-mascot--reacting .client-mascot__img {
    animation: client-mascot-wiggle 320ms ease-in-out;
}

@keyframes client-mascot-wiggle {
    0% {
        transform: scale(1) rotate(0deg);
    }

    30% {
        transform: scale(1.06) rotate(-3deg);
    }

    60% {
        transform: scale(1.04) rotate(2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* ── New variants ───────────────────────────────────────── */

.client-mascot--course {
    position: relative;
    margin: 16px auto 24px;
}

.client-mascot--quiz {
    position: relative;
    margin: 16px auto;
    z-index: 10;
}