(function(){if(customElements.get('bacci-guide'))return;
var IMG='https://cdn.shopify.com/s/files/1/0500/7307/5871/files/Bacci-Atelier-Character.png?v=1790967006&width=360';
var CSS=':host{position:fixed;right:10px;bottom:12px;z-index:2147483000;pointer-events:none;font-family:"Avenir Next","Segoe UI",Arial,sans-serif}'+
'*{box-sizing:border-box}.w{position:relative;display:flex;flex-direction:column;align-items:flex-end}'+
'.b{pointer-events:auto;cursor:pointer;position:relative;width:110px;height:165px;border:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;animation:in 1.1s cubic-bezier(.2,.9,.25,1.15) both}'+
'.f{position:absolute;inset:0;animation:fl 6s ease-in-out infinite}'+
'.h{position:absolute;left:8%;right:8%;top:22%;bottom:2%;border-radius:50%;background:radial-gradient(ellipse,#f8e7b0aa,#e8cdf766 40%,#9bcccb22 60%,transparent 72%);filter:blur(14px);animation:gl 4s ease-in-out infinite}'+
'.f img{position:relative;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 10px 14px #0009);animation:br 4s ease-in-out infinite;transform-origin:50% 90%}'+
'.s{position:absolute;width:10px;height:10px;background:radial-gradient(circle,#fff,#f8e7b0 35%,transparent 70%);opacity:0;pointer-events:none}'+
'.s:before,.s:after{content:"";position:absolute;left:4px;top:-4px;width:2px;height:18px;background:linear-gradient(#0000,#fff,#0000)}.s:after{transform:rotate(90deg)}'+
'.s.on{animation:sp 1.3s ease-out}'+
'.bub{pointer-events:auto;position:relative;max-width:min(270px,calc(100vw - 40px));margin:0 6px 8px 0;padding:14px 16px 14px;border-radius:20px 20px 6px 20px;background:linear-gradient(160deg,#1a1648f2,#0b0a26f5);border:1px solid #d4ab5a99;box-shadow:0 10px 30px #0008,0 0 24px #6b4fd855;color:#fff8ea;font-size:16px;line-height:1.35;transform-origin:100% 100%;transition:opacity .35s,transform .35s cubic-bezier(.2,.9,.3,1.2)}'+
'.bub.x{opacity:0;transform:scale(.6) translateY(16px);pointer-events:none}'+
'.t{font-family:Georgia,serif;font-size:17px;padding-right:18px;min-height:1.3em;transition:opacity .3s}.t.fd{opacity:0}'+
'.c{position:absolute;top:4px;right:6px;width:28px;height:28px;border:0;background:none;color:#f8e7b0;font-size:20px;cursor:pointer;line-height:1}'+
'.cta{display:inline-block;margin-top:10px;padding:10px 18px;border-radius:999px;background:linear-gradient(90deg,#b8893a,#f8e7b0,#d4ab5a);color:#1a1230;font-weight:700;font-size:15px;text-decoration:none;box-shadow:0 4px 14px #d4ab5a55}'+
'.o{pointer-events:auto;display:none;width:46px;height:46px;border-radius:50%;border:0;cursor:pointer;background:radial-gradient(circle at 35% 30%,#fff,#e8cdf7 30%,#aca1de 55%,#9bcccb 75%,#54527e);box-shadow:0 0 18px #f8e7b0aa,0 0 36px #6b4fd888;animation:og 3s ease-in-out infinite,in .6s both}'+
'.min .o{display:block}.min .b,.min .bub{display:none}'+
'@keyframes in{from{opacity:0;transform:translateY(40px) scale(.7)}to{opacity:1;transform:none}}'+
'@keyframes fl{0%,100%{transform:translateY(0) rotate(-.6deg)}50%{transform:translateY(-9px) rotate(.6deg)}}'+
'@keyframes og{0%,100%{box-shadow:0 0 14px #f8e7b099,0 0 28px #6b4fd866}50%{box-shadow:0 0 24px #f8e7b0,0 0 46px #6b4fd8aa}}'+
'@keyframes br{0%,100%{transform:scale(1)}50%{transform:scale(1.015,1.025)}}'+
'@keyframes gl{0%,100%{opacity:.75}50%{opacity:1;filter:blur(18px) brightness(1.15)}}'+
'@keyframes sp{0%{opacity:0;transform:scale(.2) rotate(0)}30%{opacity:1;transform:scale(1.2) rotate(45deg)}100%{opacity:0;transform:scale(.4) rotate(120deg)}}'+
'@media(min-width:768px){:host{right:20px;bottom:18px}.b{width:150px;height:225px}}'+
'@media(prefers-reduced-motion:reduce){.b,.f,.h,.f img,.o,.s.on{animation:none!important}.bub{transition:none}}';
function el(t,c,p){var e=document.createElement(t);if(c)e.className=c;if(p)p.appendChild(e);return e}
class G extends HTMLElement{
connectedCallback(){if(this._r)return;this._r=1;var me=this,sh=this.attachShadow({mode:'open'});
var st=el('style',0,sh);st.textContent=CSS;var w=el('div','w',sh);
var bub=el('div','bub x',w);bub.setAttribute('role','status');bub.setAttribute('aria-live','polite');
var t=el('div','t',bub);var c=el('button','c',bub);c.textContent='×';c.setAttribute('aria-label','Hide Bacci');
var ct=this.getAttribute('cta-text'),ch=this.getAttribute('cta-href');
if(ct&&ch){var a=el('a','cta',bub);a.textContent=ct;a.href=ch}
var b=el('button','b',w);b.setAttribute('aria-label','Talk to Bacci');
var f=el('div','f',b);el('div','h',f);var im=el('img',0,f);im.src=IMG;im.alt='Bacci';im.decoding='async';
var sp=[];for(var i=0;i<3;i++)sp.push(el('i','s',f));
var o=el('button','o',w);o.setAttribute('aria-label','Bring Bacci back');
this.L=(this.getAttribute('lines')||'Hi! I am Bacci.|Tap me anytime!').split('|').map(function(s){return s.trim()}).filter(Boolean);
this.i=0;this.w=w;this.bub=bub;this.t=t;t.textContent=this.L[0];
this.rm=matchMedia('(prefers-reduced-motion: reduce)').matches;
b.onclick=function(){me.toggle()};c.onclick=function(e){e.stopPropagation();me.min(1)};o.onclick=function(){me.min(0);me.open()};
this.to=setTimeout(function(){if(!me.opened)me.open()},1500);
if(!this.rm)this.sk=setInterval(function(){var s=sp[Math.random()*3|0];s.style.left=(10+Math.random()*75)+'%';s.style.top=(10+Math.random()*60)+'%';s.classList.remove('on');void s.offsetWidth;s.classList.add('on')},2600)}
open(){var me=this;this.opened=1;this.bub.classList.remove('x');clearInterval(this.rt);
if(this.L.length>1)this.rt=setInterval(function(){me.next()},6000)}
close(){this.bub.classList.add('x');clearInterval(this.rt)}
toggle(){if(this.bub.classList.contains('x')){this.next();this.open()}else this.close()}
next(){var me=this;this.i=(this.i+1)%this.L.length;if(this.rm){this.t.textContent=this.L[this.i];return}
this.t.classList.add('fd');setTimeout(function(){me.t.textContent=me.L[me.i];me.t.classList.remove('fd')},300)}
min(on){this.w.classList.toggle('min',!!on);if(on)this.close()}
disconnectedCallback(){clearInterval(this.rt);clearInterval(this.sk);clearTimeout(this.to)}}
customElements.define('bacci-guide',G)})();