.ycbb-widget {
    --ycbb-scale: 0.5;
    position: fixed;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 9990;
    width: 96px;
    height: 104px;
}

.ycbb-pet {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ycbb-speech {
    position: absolute;
    right: calc(100% + 12px);
    bottom: 52px;
    box-sizing: border-box;
    width: max-content;
    max-width: min(260px, calc(100vw - 132px));
    padding: 12px 15px;
    border: 1px solid #222;
    border-radius: 16px 16px 4px 16px;
    background: #fff;
    color: #222;
    box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
    font: 600 15px/1.35 system-ui, sans-serif;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.ycbb-speech[hidden] {
    display: none;
}

.ycbb-pet:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
    border-radius: 16px;
}

.ycbb-pet__sprite {
    position: absolute;
    right: 0;
    bottom: 0;
    display: block;
    width: 192px;
    height: 208px;
    background-image: var(--ycbb-sprite);
    background-repeat: no-repeat;
    background-size: 1536px 2288px;
    background-position: 0 0;
    transform: scale(var(--ycbb-scale));
    transform-origin: right bottom;
    pointer-events: none;
    user-select: none;
}

@media (max-width: 640px) {
    .ycbb-widget {
        --ycbb-scale: 0.4;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 77px;
        height: 84px;
    }

    .ycbb-speech {
        bottom: 42px;
        max-width: calc(100vw - 112px);
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ycbb-pet {
        cursor: default;
    }
}
