/* Linka – assistant animé LINKAD. Tout est préfixé #lk-root pour ne jamais toucher au thème. */
#lk-root{--lk-surface:#ffffff;--lk-fg:#14222e;--lk-muted:#5b6b78;--lk-line:#dbe3e9;--lk-brand:#0a6aa8;--lk-ink:#ffffff;--lk-accent:#f2a33a;--lk-shadow:0 18px 50px rgba(10,40,70,.18);font-family:inherit;line-height:1.45;color:var(--lk-fg)}
#lk-root *,#lk-root *::before,#lk-root *::after{box-sizing:border-box}
#lk-root [hidden]{display:none!important}
/* Neutralise les styles de boutons/champs du thème (Hestia met tout en majuscules, ombres, etc.) */
#lk-root button,#lk-root input{all:unset;box-sizing:border-box;font-family:inherit}
#lk-root button{cursor:pointer;-webkit-tap-highlight-color:transparent}
#lk-root button:focus-visible,#lk-root input:focus-visible{outline:3px solid var(--lk-accent);outline-offset:2px}

#lk-root .lk-stage{position:fixed;right:calc(12px + env(safe-area-inset-right,0px));bottom:calc(10px + env(safe-area-inset-bottom,0px));z-index:99990;display:flex;align-items:flex-end;gap:6px;pointer-events:none;transform:translateX(calc(-100vw - 240px))}
#lk-root .lk-stage.in{animation:lk-walkin 7.5s cubic-bezier(.3,.5,.45,1) forwards}
#lk-root .lk-stage.here{transform:none;animation:lk-pop .5s ease}
@keyframes lk-walkin{from{transform:translateX(calc(-100vw - 240px))}to{transform:translateX(0)}}
#lk-root .lk-stage > *{pointer-events:auto}
#lk-root .lk-talkzone{display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:290px;margin-bottom:60px}
#lk-root .lk-bubble{background:var(--lk-surface);color:var(--lk-fg);border:1px solid var(--lk-line);box-shadow:var(--lk-shadow);border-radius:18px 18px 4px 18px;padding:10px 14px;font-size:14.5px;animation:lk-pop .3s ease;white-space:pre-line}
@keyframes lk-pop{from{transform:scale(.85);opacity:0}to{transform:none;opacity:1}}
#lk-root .lk-bubble form{display:flex;gap:6px;margin-top:8px}
#lk-root .lk-bubble input{flex:1;min-width:0;border:1px solid var(--lk-line);background:#f3f6f8;color:var(--lk-fg);border-radius:10px;padding:8px 10px;font-size:14px}
#lk-root .lk-bubble form button{background:var(--lk-brand);color:var(--lk-ink);border-radius:10px;padding:8px 12px;font-weight:700;font-size:14px}
#lk-root .lk-opts{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
#lk-root .lk-opt{background:var(--lk-brand);color:var(--lk-ink);border-radius:999px;padding:8px 14px;font-weight:700;font-size:13.5px;box-shadow:0 6px 16px rgba(10,60,110,.25);animation:lk-slide .35s ease backwards}
#lk-root .lk-opt.ghost{background:var(--lk-surface);color:var(--lk-brand);border:1px solid var(--lk-brand)}
@keyframes lk-slide{from{transform:translateX(20px);opacity:0}to{transform:none;opacity:1}}
#lk-root .lk-figure{position:relative;display:flex;flex-direction:column;align-items:center}
#lk-root .lk-char{width:140px;height:163px;display:block}
#lk-root .lk-char svg{width:100%;height:100%;overflow:visible;display:block}
#lk-root .lk-tag{font-size:11px;font-weight:700;color:var(--lk-muted);background:var(--lk-surface);border:1px solid var(--lk-line);border-radius:999px;padding:2px 9px;margin-top:-6px}
#lk-root .lk-ctrls{position:absolute;top:4px;right:0;display:flex;flex-direction:column;gap:6px;z-index:2}
#lk-root .lk-ctrl{width:32px;height:32px;border-radius:50%;border:1px solid var(--lk-line);background:var(--lk-surface);color:var(--lk-fg);font-size:15px;display:grid;place-items:center;box-shadow:0 4px 10px rgba(0,0,0,.1)}
#lk-root .lk-ctrl[aria-pressed="false"]{opacity:.5;text-decoration:line-through}
#lk-root .lk-touch{position:absolute;left:-6px;top:46%;background:var(--lk-accent);color:#2a1a00;font-size:12px;font-weight:800;border-radius:999px;padding:4px 10px;animation:lk-nudge 1.2s ease-in-out infinite;pointer-events:none}
@keyframes lk-nudge{0%,100%{transform:translateX(0)}50%{transform:translateX(-6px)}}
#lk-root .lk-mini{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:99990;width:64px;height:64px;border-radius:50%;border:3px solid var(--lk-brand);background:var(--lk-surface);box-shadow:var(--lk-shadow);overflow:hidden}
#lk-root .lk-mini svg{width:100%;height:100%;display:block}

/* --- Animations du personnage (état = classe sur le SVG) --- */
#lk-root .c *{transform-box:fill-box}
#lk-root .body-all{transform-origin:center bottom;animation:lk-breathe 3.2s ease-in-out infinite}
@keyframes lk-breathe{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
#lk-root .head{transform-origin:center bottom;transition:transform .4s ease}
#lk-root .eye{transform-origin:center;animation:lk-wink 4.5s infinite}
@keyframes lk-wink{0%,93%,100%{transform:scaleY(1)}96%{transform:scaleY(.08)}}
#lk-root .pupils{transition:transform .2s ease}
#lk-root .brow{transform-origin:center;transition:transform .3s ease}
#lk-root .mouth-smile{transition:opacity .12s}
#lk-root .mouth-open{opacity:0;transform-origin:center top}
#lk-root .armL,#lk-root .armR{transform-origin:50% 6%;transition:transform .45s cubic-bezier(.3,1.4,.5,1)}
#lk-root .legL,#lk-root .legR{transform-origin:50% 0}
#lk-root .thought{opacity:0;transition:opacity .3s}
#lk-root .cheek{opacity:.35;transition:opacity .3s}
#lk-root .shadow{transform-origin:center;animation:lk-shadow 3.2s ease-in-out infinite}
@keyframes lk-shadow{0%,100%{transform:scaleX(1)}50%{transform:scaleX(.9)}}
#lk-root .happy-eyes{opacity:0}

#lk-root .c.st-wave .armR{animation:lk-wave .32s ease-in-out infinite alternate}
@keyframes lk-wave{from{transform:rotate(-165deg)}to{transform:rotate(-120deg)}}
#lk-root .c.st-wave .head{transform:rotate(-5deg)}

#lk-root .c.st-think .armL{transform:rotate(-128deg)}
#lk-root .c.st-think .head{transform:rotate(6deg)}
#lk-root .c.st-think .pupils{transform:translate(3px,-4px)}
#lk-root .c.st-think .brow.l{transform:translateY(-2px) rotate(-12deg)}
#lk-root .c.st-think .brow.r{transform:translateY(-3px) rotate(10deg)}
#lk-root .c.st-think .bulb{animation:lk-pulse .45s ease-in-out infinite alternate}
@keyframes lk-pulse{from{fill:#f2a33a}to{fill:#fff2b0}}
#lk-root .c.st-think .thought{opacity:1}
#lk-root .c.st-think .thought circle{animation:lk-float 1.2s ease-in-out infinite}
#lk-root .c.st-think .thought circle:nth-child(2){animation-delay:.2s}
#lk-root .c.st-think .thought circle:nth-child(3){animation-delay:.4s}
@keyframes lk-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}

#lk-root .c.st-talk .mouth-smile{opacity:0}
#lk-root .c.st-talk .mouth-open{opacity:1;animation:lk-talk .14s ease-in-out infinite alternate}
@keyframes lk-talk{from{transform:scaleY(.2)}to{transform:scaleY(1)}}
#lk-root .c.st-talk .armR{transform:rotate(-38deg)}
#lk-root .c.st-talk .head{animation:lk-nod 1s ease-in-out infinite}
@keyframes lk-nod{0%,100%{transform:rotate(0)}50%{transform:rotate(-3deg)}}

#lk-root .c.st-happy .body-all{animation:lk-jump .45s ease-out 3}
@keyframes lk-jump{0%,100%{transform:translateY(0)}40%{transform:translateY(-16px)}}
#lk-root .c.st-happy .armL{transform:rotate(-150deg)}
#lk-root .c.st-happy .armR{transform:rotate(150deg)}
#lk-root .c.st-happy .eye-open{opacity:0}
#lk-root .c.st-happy .happy-eyes{opacity:1}
#lk-root .c.st-happy .cheek{opacity:.85}

#lk-root .c.st-ouch .head{animation:lk-shake .08s linear 6}
@keyframes lk-shake{0%,100%{transform:translateX(0)}50%{transform:translateX(-3px)}}
#lk-root .c.st-ouch .eye-open{opacity:0}
#lk-root .c.st-ouch .happy-eyes{opacity:1;transform:scaleY(-1)}
#lk-root .c.st-ouch .mouth-smile{opacity:0}
#lk-root .c.st-ouch .mouth-open{opacity:1;transform:scale(.8,.6)}
#lk-root .c.st-ouch .cheek{opacity:.9}

#lk-root .c.st-walk .legL{animation:lk-legs .45s ease-in-out infinite alternate}
#lk-root .c.st-walk .legR{animation:lk-legs .45s ease-in-out infinite alternate-reverse}
@keyframes lk-legs{from{transform:rotate(20deg)}to{transform:rotate(-20deg)}}
#lk-root .c.st-walk .body-all{animation:lk-step .45s ease-in-out infinite alternate}
@keyframes lk-step{from{transform:translateY(0) rotate(-2deg)}to{transform:translateY(-6px) rotate(2deg)}}
#lk-root .c.st-walk .armR{animation:lk-wave .45s ease-in-out infinite alternate}
#lk-root .c.st-walk .armL{animation:lk-swing .9s ease-in-out infinite alternate}
@keyframes lk-swing{from{transform:rotate(22deg)}to{transform:rotate(-22deg)}}
#lk-root .c.st-walk .mouth-smile{opacity:0}
#lk-root .c.st-walk .mouth-open{opacity:1;transform:scale(.9,.7)}

#lk-root .c.st-hop .body-all{animation:lk-jump .42s ease-out 2}
#lk-root .c.st-hop .armR{animation:lk-wave .3s ease-in-out infinite alternate}
#lk-root .c.st-hop .armL{transform:rotate(-140deg)}
#lk-root .c.st-spin .body-all{animation:lk-spin .7s ease-in-out}
@keyframes lk-spin{0%{transform:scaleX(1)}25%{transform:scaleX(-1) translateY(-8px)}50%{transform:scaleX(1) translateY(-12px)}75%{transform:scaleX(-1) translateY(-6px)}100%{transform:scaleX(1)}}

#lk-root .c.dance.st-idle .body-all{animation:lk-sway 1s ease-in-out infinite alternate}
@keyframes lk-sway{from{transform:rotate(-5deg)}to{transform:rotate(5deg) translateY(-3px)}}
#lk-root .c.dance.st-idle .head{animation:lk-bop .5s ease-in-out infinite alternate}
@keyframes lk-bop{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}
#lk-root .c.dance.st-idle .armL{animation:lk-swing 1s ease-in-out infinite alternate}
#lk-root .c.dance.st-idle .armR{animation:lk-swing 1s ease-in-out infinite alternate-reverse}


/* =========================================================
   Version 1.3 : Linka au féminin, Fibre, clins d'œil, lunettes, saisons
   ========================================================= */
/* Queue de cheval */
#lk-root .pony{transform-origin:10% 5%;animation:lk-pony 3.2s ease-in-out infinite alternate}
@keyframes lk-pony{from{transform:rotate(-4deg)}to{transform:rotate(7deg)}}
#lk-root .c.st-walk .pony{animation-duration:.45s}
#lk-root .c.st-happy .pony,#lk-root .c.st-hop .pony{animation:lk-pony .25s ease-in-out infinite alternate}
/* Entrée en dansant + pirouette */
#lk-root .c.st-walk .body-all{animation:lk-step2 .45s ease-in-out infinite alternate}
@keyframes lk-step2{from{transform:translateY(0) rotate(-7deg)}to{transform:translateY(-7px) rotate(7deg)}}
#lk-root .c.st-walk .armR{animation:lk-danceR .9s ease-in-out infinite alternate}
@keyframes lk-danceR{from{transform:rotate(-160deg)}to{transform:rotate(-100deg)}}
#lk-root .c.st-walk .armL{animation:lk-danceL .9s ease-in-out infinite alternate}
@keyframes lk-danceL{from{transform:rotate(100deg)}to{transform:rotate(160deg)}}
#lk-root .c.st-walk .head{animation:lk-bop .45s ease-in-out infinite alternate}
#lk-root .c.st-walk .eye-open{opacity:0}
#lk-root .c.st-walk .happy-eyes{opacity:1}
#lk-root .lk-char.twirl{animation:lk-twirl 1s ease-in-out}
@keyframes lk-twirl{0%{transform:scaleX(1)}25%{transform:scaleX(-1) translateY(-10px)}50%{transform:scaleX(1) translateY(-16px)}75%{transform:scaleX(-1) translateY(-8px)}100%{transform:scaleX(1)}}
/* Clin d'œil et lunettes remontées */
#lk-root .wink-lid{opacity:0;transition:opacity .08s}
#lk-root .c.st-wink .wink-lid{opacity:1}
#lk-root .c.st-wink .head{transform:rotate(-6deg)}
#lk-root .c.st-wink .armR{transform:rotate(-150deg)}
#lk-root .glasses{transition:transform .3s ease .3s}
#lk-root .c.st-glasses .armR{transform:rotate(160deg)}
#lk-root .c.st-glasses .glasses{transform:translateY(-2px)}
/* Tenues de saison */
#lk-root .hat,#lk-root .sunny{display:none}
#lk-root .c.s-halloween .hat-halloween,#lk-root .c.s-noel .hat-noel,#lk-root .c.s-nouvelan .hat-nouvelan,#lk-root .c.s-ete .sunny{display:inline}
/* Fibre, le petit robot-chien */
#lk-root .lk-fibre{position:absolute;left:-40px;bottom:22px;width:54px;height:47px;z-index:1}
#lk-root .lk-fibre svg{width:100%;height:100%;overflow:visible;display:block}
#lk-root .f *{transform-box:fill-box}
#lk-root .fbody{transform-origin:center bottom;animation:lk-fbreath 2.4s ease-in-out infinite}
@keyframes lk-fbreath{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.5px)}}
#lk-root .ftail{transform-origin:0% 90%;animation:lk-wag .35s ease-in-out infinite alternate}
@keyframes lk-wag{from{transform:rotate(-14deg)}to{transform:rotate(14deg)}}
#lk-root .ftip{animation:lk-glow 1.6s ease-in-out infinite alternate}
@keyframes lk-glow{from{fill:#7fd3ff}to{fill:#e9fbff}}
#lk-root .fhead{transform-origin:50% 90%;transition:transform .35s ease}
#lk-root .fear{transform-origin:50% 100%;animation:lk-ear 3.5s ease-in-out infinite}
#lk-root .fear.r{animation-delay:.4s}
@keyframes lk-ear{0%,88%,100%{transform:rotate(0)}93%{transform:rotate(-14deg)}}
#lk-root .feyes{transform-origin:center;animation:lk-wink 3.8s infinite}
#lk-root .fhappy,#lk-root .ftongue{opacity:0}
#lk-root .f.st-think .fhead{transform:rotate(-14deg)}
#lk-root .f.st-think .fbulb{animation:lk-pulse .3s ease-in-out infinite alternate}
#lk-root .f.st-happy .fbody,#lk-root .f.st-hop .fbody,#lk-root .f.st-walk .fbody{animation:lk-fjump .4s ease-out infinite}
@keyframes lk-fjump{0%,100%{transform:translateY(0)}40%{transform:translateY(-10px)}}
#lk-root .f.st-happy .feyes,#lk-root .f.st-ouch .feyes{opacity:0}
#lk-root .f.st-happy .fhappy,#lk-root .f.st-ouch .fhappy{opacity:1}
#lk-root .f.st-happy .ftongue,#lk-root .f.st-talk .ftongue,#lk-root .f.st-wave .ftongue{opacity:1}
#lk-root .f.st-happy .ftail,#lk-root .f.st-wave .ftail{animation-duration:.15s}
#lk-root .f.st-talk .fhead{animation:lk-nod 1s ease-in-out infinite}
@media (max-width:560px){#lk-root .lk-fibre{left:-34px;width:44px;height:38px;bottom:18px}}

@media (prefers-reduced-motion:reduce){
  #lk-root *{animation-duration:.01s!important;animation-iteration-count:1!important;transition:none!important}
  #lk-root .lk-stage{transform:none}
}
@media (max-width:560px){
  #lk-root .lk-stage{flex-direction:column;align-items:flex-end;gap:2px;left:calc(12px + env(safe-area-inset-left,0px))}
  #lk-root .lk-talkzone{margin-bottom:0;max-width:100%}
  #lk-root .lk-opts{flex-direction:row;flex-wrap:wrap;justify-content:flex-end}
  #lk-root .lk-char{width:104px;height:121px}
}
