/* ==========================================================
   MASCOT SYSTEM — KidMint character family
   Minto (elephant), Tara (parrot), Bobo (monkey), Nila (bunny)
   ========================================================== */

/* ---------- Base ---------- */
.mascot {
    display: inline-block;
    flex-shrink: 0;
    object-fit: contain;
    vertical-align: middle;
    user-select: none;
    pointer-events: none;
}

/* ---------- Sizes ---------- */
.mascot-sm  { width: 48px;  height: 48px;  }
.mascot-md  { width: 80px;  height: 80px;  }
.mascot-lg  { width: 120px; height: 120px; }
.mascot-xl  { width: 180px; height: 180px; }
.mascot-hero { width: 240px; height: 240px; }

/* ---------- Gentle hover bounce ---------- */
.mascot-bounce {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mascot-bounce:hover,
a:hover .mascot-bounce,
button:hover .mascot-bounce {
    transform: scale(1.08) translateY(-4px);
}

/* ---------- Idle float animation ---------- */
.mascot-float {
    animation: mascot-float 3s ease-in-out infinite;
}

@keyframes mascot-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ---------- Pop-in entrance ---------- */
.mascot-pop {
    animation: mascot-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes mascot-pop-in {
    0%   { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---------- Celebration wiggle ---------- */
.mascot-wiggle {
    animation: mascot-wiggle 0.6s ease 2;
}

@keyframes mascot-wiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-8deg); }
    75%      { transform: rotate(8deg); }
}

/* ---------- Inline mascot with text ---------- */
.mascot-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mascot-inline .mascot {
    width: 32px;
    height: 32px;
}

/* ---------- Hero mascot positioning ---------- */
.mascot-hero-wrap,
.hero-mascot-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-mascot-wrap .mascot {
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 8px 18px var(--shadow-color, rgba(50, 70, 92, 0.13)));
}

/* ---------- Card corner mascot ---------- */
.mascot-card-corner {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 4px 8px var(--shadow-color, rgba(50, 70, 92, 0.12)));
}

/* ---------- Feedback mascot (correct/wrong response) ---------- */
.mascot-feedback {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
}

/* ---------- Section mascot (beside section headings) ---------- */
.section-heading-mascot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-heading-mascot .mascot {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .mascot-hero { width: 160px; height: 160px; }
    .hero-mascot-wrap .mascot { width: 140px; height: 140px; }
    .mascot-xl   { width: 120px; height: 120px; }
    .mascot-lg   { width: 80px;  height: 80px;  }
    .mascot-card-corner { width: 40px; height: 40px; }
    .mascot-says { flex-direction: column; text-align: center; gap: 0.35rem; }
    .mascot-says-bubble { font-size: 0.92rem; }
}

/* ---------- Mascot speech-bubble strip ---------- */
.mascot-says {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: var(--bg-surface);
    border: 1.5px solid var(--line);
    max-width: 480px;
}

.mascot-says-avatar { flex-shrink: 0; }
.mascot-says-avatar .mascot { width: 40px; height: 40px; }

.mascot-says-bubble { display: flex; flex-direction: column; gap: 0.15rem; }
.mascot-says-name {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.mascot-says-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink);
}

/* Tone variants */
.mascot-says-reward {
    background: linear-gradient(135deg, rgba(255, 216, 77, 0.18), rgba(255, 255, 255, 0.96));
    border-color: rgba(255, 216, 77, 0.4);
}
.mascot-says-hint {
    background: linear-gradient(135deg, rgba(89, 201, 255, 0.12), rgba(255, 255, 255, 0.96));
    border-color: rgba(89, 201, 255, 0.35);
}
.mascot-says-calm {
    background: linear-gradient(135deg, rgba(144, 202, 249, 0.12), rgba(255, 255, 255, 0.97));
    border-color: rgba(144, 202, 249, 0.3);
}

/* ---------- Completion screen dual mascot ---------- */
.mascot-completion {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
}
.mascot-completion .mascot-primary { width: 100px; height: 100px; }
.mascot-completion .mascot-secondary { width: 56px; height: 56px; opacity: 0.85; }

/* ---------- Section hero supporting mascot ---------- */
.hero-supporting-mascot {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 64px;
    height: 64px;
    opacity: 0.8;
    filter: drop-shadow(0 4px 8px var(--shadow-color, rgba(50, 70, 92, 0.1)));
}

/* ---------- Parent-facing (subtle) mascot ---------- */
.mascot-parent-subtle { opacity: 0.65; }
.mascot-parent-subtle .mascot { width: 36px; height: 36px; }

/* ---------- Inclusive-support soft treatment ---------- */
.section-inclusive-support .mascot {
    filter: saturate(0.85) brightness(1.05);
}
.section-inclusive-support .mascot-says {
    border-color: rgba(144, 202, 249, 0.25);
    background: linear-gradient(135deg, rgba(144, 202, 249, 0.08), rgba(255, 255, 255, 0.97));
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .mascot-float,
    .mascot-pop,
    .mascot-wiggle,
    .mascot-bounce {
        animation: none !important;
        transition: none !important;
    }
}
