@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;900&display=swap');

:root {
    --bot-size: clamp(34px, 7.2vw, 132px);
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: transparent;
    font-family: 'Nunito', Arial, sans-serif;
}

#obs-bot-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: transparent;
}

#obs-bot-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

html.panel-surface,
html.panel-surface body,
html.panel-surface #obs-bot-stage {
    background: rgba(255, 247, 231, 0.86);
}

html.panel-surface.dark-mode,
html.panel-surface.dark-mode body,
html.panel-surface.dark-mode #obs-bot-stage {
    background: rgba(36, 20, 35, 0.86);
}

.obs-bot {
    position: absolute;
    left: 0;
    bottom: var(--bot-bottom, 32px);
    width: var(--bot-size);
    height: var(--bot-size);
    transform: translate3d(var(--bot-x, 0px), 0, 0);
    transition: transform var(--walk-duration, 5s) linear, opacity 0.75s ease;
    will-change: transform, opacity;
    pointer-events: none;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.35));
}

.obs-bot-name {
    position: absolute;
    top: calc(100% - 4px);
    left: 50%;
    max-width: 150%;
    padding: 0.22em 0.62em 0.28em;
    border-radius: 999px;
    background: rgba(16, 8, 20, 0.72);
    color: #ffffff;
    font-size: clamp(7px, 1.05vw, 19px);
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    z-index: 4;
}

.obs-bot.is-hidden {
    opacity: 0;
}

.obs-bot.is-placing {
    transition: opacity 0.75s ease;
}

.obs-bot.is-dying {
    opacity: 0;
    transition: opacity 0.9s ease 2.7s, transform 0.9s ease 2.7s;
}

.obs-bot-sprite {
    position: relative;
    width: 100%;
    height: 100%;
    animation: obs-bot-breathe 1.35s ease-in-out infinite;
    transform-origin: 50% 90%;
}

.obs-bot.facing-left .obs-bot-sprite {
    scale: -1 1;
}

.obs-bot.walking .obs-bot-sprite {
    animation: obs-bot-walk 0.44s ease-in-out infinite;
}

.obs-bot-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.obs-bot-layer.body {
    z-index: 1;
}

.obs-bot-layer.head {
    z-index: 2;
}

.obs-bot-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    min-width: 1.7em;
    padding: 0.22em 0.38em 0.3em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f1022;
    font-size: clamp(12px, 2.4vw, 44px);
    line-height: 1;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.85);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.obs-bot-bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% - 1px);
    width: 0;
    height: 0;
    border-left: 0.28em solid transparent;
    border-right: 0.28em solid transparent;
    border-top: 0.34em solid rgba(255, 255, 255, 0.92);
    transform: translateX(-50%);
}

.obs-bot-bubble.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

@keyframes obs-bot-breathe {
    0%, 100% {
        transform: scale(1, 1);
    }
    50% {
        transform: scale(1.018, 0.97);
    }
}

@keyframes obs-bot-walk {
    0%, 100% {
        transform: translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateY(-4%) rotate(1deg);
    }
}
