/* Mascote animado do Bot Manager — componente <x-mascot>.
   Camadas recortadas da arte original + rosto LED em SVG (ver resources/js/mascot). */

.bm-m,
.bm-bubble {
    --bm-bubble-bg: #ffffff;
    --bm-bubble-fg: #1f2937;
    --bm-bubble-border: #e5e7eb;
    --bm-accent: #8b5cf6;
}

html.dark .bm-bubble {
    --bm-bubble-bg: #1f2937;
    --bm-bubble-fg: #f3f4f6;
    --bm-bubble-border: #374151;
}

.bm-m {
    --bm-size: 260px;
    --bm-ratio: 1;
    position: relative;
    display: inline-block;
    width: var(--bm-size);
    max-width: 100%;
    line-height: 0;
    vertical-align: bottom;
    -webkit-tap-highlight-color: transparent;
}

html.dark .bm-m,
.bm-m.bm-m--on-dark {
    --bm-bubble-bg: #1f2937;
    --bm-bubble-fg: #f3f4f6;
    --bm-bubble-border: #374151;
}

.bm-m__stage {
    position: relative;
    width: 100%;
    aspect-ratio: var(--bm-ratio);
}

.bm-m__poster {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.bm-m__stage > .bm-m__poster {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(100% / var(--bm-scene, 1));
}

.bm-m.is-live .bm-m__poster {
    visibility: hidden;
}

.bm-m__figure {
    position: absolute;
    left: 0;
    top: 0;
    visibility: hidden;
}

.bm-m.is-live .bm-m__figure {
    visibility: visible;
}

.bm-m--crop-bust .bm-m__stage {
    clip-path: inset(-60% -60% 0 -60%);
}

.bm-m--crop-bust .bm-m__shadow {
    display: none;
}

.bm-m__body,
.bm-m__breath,
.bm-m__rig,
.bm-m__part,
.bm-m__sway {
    position: absolute;
    inset: 0;
}

.bm-m__body {
    will-change: transform;
}

.bm-m__breath {
    transform-origin: 46% 94%;
    animation: bm-breath 3.8s ease-in-out infinite;
}

.bm-m.is-asleep .bm-m__breath {
    animation-duration: 5.6s;
}

.bm-m__part--antenna > .bm-m__sway {
    animation: bm-sway 4.6s ease-in-out infinite;
}

.bm-m.is-paused .bm-m__breath,
.bm-m.is-paused .bm-m__sway,
.bm-m.is-paused .bm-m__dot,
.bm-m.is-paused .bm-m__panel-gear {
    animation-play-state: paused;
}

.bm-m.is-reduced .bm-m__breath,
.bm-m.is-reduced .bm-m__sway {
    animation: none;
}

.bm-m__layer {
    position: absolute;
    display: block;
    max-width: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.bm-m__face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.bm-m__shadow {
    position: absolute;
    left: 24%;
    right: 30%;
    bottom: 3%;
    height: 4%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0));
    transform-origin: center;
}

.bm-m[data-pose="thinker"] .bm-m__shadow {
    bottom: 1%;
}

.bm-m[data-pose="mechanic"] .bm-m__shadow {
    bottom: 7%;
    left: 20%;
    right: 34%;
}

.bm-m__fxhost {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.bm-m__fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bm-m.is-interactive .bm-m__stage {
    cursor: pointer;
}

/* Reticências do "pensando" */
.bm-m__dot {
    animation: bm-dot 1.2s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.bm-m__dot--1 { animation-delay: 0.15s; }
.bm-m__dot--2 { animation-delay: 0.3s; }

.bm-m.is-reduced .bm-m__dot {
    animation: none;
}

/* ---------------------------------------------------------------- painel do conserto */
.bm-m__panel {
    position: absolute;
    left: 66.5%;
    top: 26%;
    width: 30%;
    aspect-ratio: 1 / 0.86;
    border-radius: 9% / 10%;
    background: #ffffff;
    border: 2px solid #c7d2fe;
    box-shadow: 0 10px 24px rgba(30, 27, 75, 0.18);
    overflow: hidden;
    line-height: 1;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

html.dark .bm-m__panel {
    background: #1f2937;
    border-color: #4c1d95;
}

.bm-m__panel-bar {
    display: flex;
    align-items: center;
    gap: 4%;
    height: 15%;
    padding: 0 6%;
    background: #ede9fe;
}

html.dark .bm-m__panel-bar {
    background: #312e81;
}

.bm-m__panel-bar i {
    width: 5%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #c4b5fd;
}

.bm-m__panel-bar span {
    flex: 1;
    height: 34%;
    margin-left: 4%;
    border-radius: 99px;
    background: #ffffff;
    opacity: 0.8;
}

.bm-m__panel-body {
    position: relative;
    height: 85%;
}

.bm-m__panel-row {
    position: absolute;
    left: 9%;
    height: 9%;
    border-radius: 99px;
    background: #ddd6fe;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
}

.bm-m__panel-row--a { top: 12%; width: 56%; background: #a78bfa; }
.bm-m__panel-row--b { top: 31%; width: 72%; }
.bm-m__panel-row--c { top: 50%; width: 44%; }

.bm-m__panel.is-broken .bm-m__panel-row--a,
.bm-m__panel.is-fixing .bm-m__panel-row--a { transform: translate(6%, 30%) rotate(-7deg); }
.bm-m__panel.is-broken .bm-m__panel-row--b,
.bm-m__panel.is-fixing .bm-m__panel-row--b { transform: translate(-4%, 0) rotate(4deg); background: #fecaca; }
.bm-m__panel.is-broken .bm-m__panel-row--c,
.bm-m__panel.is-fixing .bm-m__panel-row--c { transform: translate(10%, 40%) rotate(-12deg); }

.bm-m__panel-gear {
    position: absolute;
    right: 9%;
    bottom: 10%;
    width: 24%;
    fill: #8b5cf6;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bm-m__panel-crack {
    position: absolute;
    left: 40%;
    top: 4%;
    width: 30%;
    fill: none;
    stroke: #ef4444;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.3s ease;
}

.bm-m__panel-status {
    position: absolute;
    left: 9%;
    bottom: 12%;
    width: 30%;
    height: 12%;
    border-radius: 99px;
    background: #ef4444;
    transition: background-color 0.3s ease;
}

.bm-m__panel.is-fixing .bm-m__panel-status { background: #f59e0b; }
.bm-m__panel.is-fixed { border-color: #34d399; }
.bm-m__panel.is-fixed .bm-m__panel-status { background: #10b981; }
.bm-m__panel.is-fixed .bm-m__panel-crack { opacity: 0; }
.bm-m__panel.is-fixed .bm-m__panel-gear { fill: #10b981; }

.bm-m__panel.is-jolt {
    animation: bm-jolt 0.24s ease-out;
}

.bm-m.is-reduced .bm-m__panel.is-jolt {
    animation: none;
}

/* ---------------------------------------------------------------- balão de fala */
.bm-bubble {
    position: absolute;
    z-index: 5;
    box-sizing: border-box;
    max-width: min(280px, calc(100vw - 32px));
    padding: 12px 36px 12px 14px;
    border: 1px solid var(--bm-bubble-border);
    border-radius: 16px;
    background: var(--bm-bubble-bg);
    color: var(--bm-bubble-fg);
    box-shadow: 0 12px 30px -12px rgba(30, 27, 75, 0.35), 0 2px 6px rgba(30, 27, 75, 0.08);
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

.bm-bubble.is-visible {
    opacity: 1;
    transform: none;
}

.bm-bubble.is-leaving {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
}

.bm-bubble[hidden] {
    display: none;
}

.bm-bubble__text {
    margin: 0;
    font: inherit;
    color: inherit;
}

.bm-bubble__close {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
}

.bm-bubble__close:hover,
.bm-bubble__close:focus-visible {
    opacity: 1;
    background: rgba(139, 92, 246, 0.12);
}

.bm-bubble__close:focus-visible {
    outline: 2px solid var(--bm-accent);
    outline-offset: 1px;
}

.bm-bubble__close svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.bm-bubble__close[hidden] {
    display: none;
}

/* rabinho do balão */
.bm-bubble::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bm-bubble-bg);
    border: 1px solid var(--bm-bubble-border);
    border-top: 0;
    border-left: 0;
}

.bm-bubble[data-side="right"] {
    left: calc(100% + 10px);
}

.bm-bubble[data-side="right"]::after {
    left: -7px;
    top: 18px;
    transform: rotate(135deg);
}

.bm-bubble[data-side="left"] {
    right: calc(100% + 10px);
}

.bm-bubble[data-side="left"]::after {
    right: -7px;
    top: 18px;
    transform: rotate(-45deg);
}

.bm-bubble[data-side="top"] {
    bottom: calc(100% + 10px);
}

.bm-bubble[data-side="top"]::after {
    left: calc(var(--bm-tail, 50%) - 6px);
    bottom: -7px;
    transform: rotate(45deg);
}

.bm-bubble--inline {
    position: relative;
    display: block;
    margin: 0 auto;
    max-width: 420px;
    width: auto;
}

.bm-bubble--inline::after {
    left: calc(50% - 6px);
    bottom: -7px;
    transform: rotate(45deg);
}

[data-bubble-tail="left"] .bm-bubble--inline {
    margin: 0;
}

[data-bubble-tail="left"] .bm-bubble--inline::after {
    left: -7px;
    top: 18px;
    bottom: auto;
    transform: rotate(135deg);
}

.bm-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .bm-bubble,
    .bm-bubble.is-leaving {
        transition: opacity 0.12s linear;
        transform: none;
    }
}

/* ---------------------------------------------------------------- keyframes */
@keyframes bm-breath {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.006, 1.014); }
}

@keyframes bm-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2.5deg); }
}

@keyframes bm-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-9px); opacity: 1; }
}

@keyframes bm-jolt {
    0% { transform: translate(0, 0); }
    35% { transform: translate(-1.5%, 1%) rotate(-0.8deg); }
    70% { transform: translate(1%, -0.5%) rotate(0.5deg); }
    100% { transform: translate(0, 0); }
}
