/* LittlePaper.Club — scoped floating butterfly mascot; no global styles */
#lp-mascot-widget,
#lp-mascot-widget *,
#lp-mascot-restore,
#lp-mascot-effects,
#lp-mascot-effects *{box-sizing:border-box}
#lp-mascot-widget{
  --lp-blue:#1A327A;--lp-pink:#FC445F;
  position:fixed;z-index:29;right:18px;bottom:18px;
  width:244px;height:314px;pointer-events:none;
  color:var(--lp-blue);font-family:"Nunito Sans",sans-serif;
  isolation:isolate;
}
#lp-mascot-widget[hidden]{display:none!important}
#lp-mascot-widget.lp-mascot--placed{left:var(--lp-left,18px);top:var(--lp-top,18px);right:auto;bottom:auto}
#lp-mascot-widget .lp-mascot__face{
  appearance:none;position:absolute;right:0;bottom:44px;display:block;
  width:236px;height:226px;border:0;border-radius:20px;background:transparent;padding:0;
  pointer-events:auto;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;
  filter:drop-shadow(0 10px 11px rgba(84,81,165,.15));
  animation:lp-mascot-flight 5.2s ease-in-out infinite;
  transform-origin:50% 74%;
}
#lp-mascot-widget .lp-mascot__face:focus-visible,
#lp-mascot-widget .lp-mascot__tools button:focus-visible,
#lp-mascot-restore:focus-visible{outline:3px solid #7c69ff;outline-offset:4px}
#lp-mascot-widget .lp-mascot__face svg{width:100%;height:100%;display:block;overflow:visible}
#lp-mascot-widget.lp-mascot--dragging .lp-mascot__face{cursor:grabbing;animation-play-state:paused}
#lp-mascot-widget .wing-upper{transform-box:view-box;transform-origin:280px 260px;animation:lp-wing-up 1.7s ease-in-out infinite alternate}
#lp-mascot-widget .wing-lower{transform-box:view-box;transform-origin:285px 305px;animation:lp-wing-down 1.33s ease-in-out infinite alternate}
#lp-mascot-widget .buddy-arm-left{transform-box:view-box;transform-origin:116px 340px;animation:lp-arm-wave 4.2s ease-in-out infinite}
#lp-mascot-widget .sparkle-twinkle{transform-box:fill-box;transform-origin:center;animation:lp-twinkle 2.4s ease-in-out infinite}
#lp-mascot-widget .sparkle-twinkle.second{animation-delay:.9s}
#lp-mascot-widget .sparkle-twinkle.third{animation-delay:1.6s}
#lp-mascot-widget .buddy-trail{stroke-dasharray:11 16;animation:lp-svg-trail 6s linear infinite}
/* Face paths stay unchanged: the character is ALWAYS smiling. */
#lp-mascot-widget .eye{animation:none!important;transform:none!important}
#lp-mascot-widget .lp-mascot__bubble{
  position:absolute;z-index:3;top:0;right:6px;min-width:160px;max-width:224px;
  width:max-content;padding:12px 15px;border-radius:18px 18px 5px 18px;
  background:#fff;border:1px solid #e9eafd;box-shadow:0 10px 32px rgba(32,52,122,.14);
  color:#24346c;font-size:14px;font-weight:800;line-height:1.35;text-align:center;
  pointer-events:none;opacity:1;transform:translateY(0);transition:opacity .25s,transform .25s;
}
#lp-mascot-widget .lp-mascot__bubble::after{
  content:"";position:absolute;right:25px;bottom:-8px;width:14px;height:14px;
  transform:rotate(45deg);background:#fff;border-right:1px solid #e9eafd;border-bottom:1px solid #e9eafd
}
#lp-mascot-widget .lp-mascot__bubble.lp-mascot__bubble--changing{opacity:0;transform:translateY(7px)}
#lp-mascot-widget .lp-mascot__tools{position:absolute;right:10px;bottom:0;display:flex;gap:7px;pointer-events:auto}
#lp-mascot-widget .lp-mascot__tools button{
  appearance:none;width:32px;height:32px;display:grid;place-items:center;border-radius:50%;
  border:1px solid #e6e8f9;background:#fff;color:#53638e;box-shadow:0 4px 15px rgba(34,51,112,.1);
  font-family:inherit;font-size:19px;font-weight:750;line-height:1;cursor:pointer;padding:0;
}
#lp-mascot-widget .lp-mascot__tools button:hover{color:#FC445F;background:#fff2f7}
#lp-mascot-widget .lp-mascot__tools #lp-mascot-sound{color:#f22e88;background:#fff0f7}
#lp-mascot-widget .lp-mascot__tools #lp-mascot-sound[aria-pressed="false"]{color:#9295ab;background:#f6f6fa}
#lp-mascot-widget .lp-mascot__sleep{
  position:absolute;z-index:4;top:14px;right:12px;pointer-events:none;
  padding:7px 11px;background:#fff;border:1px solid #ebe6ff;border-radius:14px 14px 14px 6px;
  color:#8564fa;box-shadow:0 8px 24px rgba(36,47,117,.13);
  font-size:16px;font-weight:900;white-space:nowrap;letter-spacing:1px;
  opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s;
}
#lp-mascot-widget .lp-mascot__sleep span{font-size:12px}
#lp-mascot-widget.lp-mascot--sleeping .lp-mascot__bubble{opacity:0;visibility:hidden}
#lp-mascot-widget.lp-mascot--sleeping .lp-mascot__sleep{opacity:1;transform:translateY(0)}
#lp-mascot-widget.lp-mascot--sleeping .lp-mascot__face{animation:lp-mascot-rest 8s ease-in-out infinite}
#lp-mascot-widget.lp-mascot--sleeping .wing-upper,
#lp-mascot-widget.lp-mascot--sleeping .wing-lower,
#lp-mascot-widget.lp-mascot--sleeping .sparkle-twinkle,
#lp-mascot-widget.lp-mascot--sleeping .buddy-arm-left,
#lp-mascot-widget.lp-mascot--sleeping .buddy-trail{animation:none!important}
#lp-mascot-restore{
  position:fixed;z-index:29;right:18px;bottom:18px;
  display:flex;align-items:center;gap:8px;padding:10px 13px;
  border:1px solid #ece6f8;border-radius:99px;cursor:pointer;background:white;
  box-shadow:0 7px 25px rgba(26,50,122,.17);color:#1A327A;
  font:800 13px "Nunito Sans",sans-serif;
}
#lp-mascot-restore[hidden]{display:none!important}
#lp-mascot-effects{position:fixed;inset:0;z-index:28;pointer-events:none;overflow:hidden}
#lp-mascot-effects .lp-mascot-particle{
  position:absolute;left:0;top:0;display:block;
  font-family:Arial,sans-serif;line-height:1;font-weight:900;
  color:var(--lp-particle-color,#fc445f);font-size:var(--lp-particle-size,27px);
  filter:drop-shadow(0 1px 2px rgba(255,82,146,.26));
  text-shadow:0 0 8px rgba(255,255,255,.95);
  transform:translate(-50%,-50%);animation:lp-particle-up 1.25s ease-out forwards;
}
#lp-mascot-effects .lp-mascot-particle--star{animation-duration:.8s}
@keyframes lp-mascot-flight{
  0%,100%{transform:translate(-5px,4px) rotate(-1.5deg)}
  25%{transform:translate(4px,-7px) rotate(1deg)}
  50%{transform:translate(8px,-10px) rotate(2deg)}
  75%{transform:translate(-2px,-2px) rotate(-.5deg)}
}
@keyframes lp-mascot-rest{0%,100%{transform:translateY(1px)}50%{transform:translateY(-4px)}}
@keyframes lp-wing-up{from{transform:rotate(-5deg) scaleX(.97)}to{transform:rotate(7deg) scaleX(.88)}}
@keyframes lp-wing-down{from{transform:rotate(5deg) scaleY(1.02)}to{transform:rotate(-6deg) scaleY(.88)}}
@keyframes lp-arm-wave{0%,72%,100%{transform:rotate(0)}80%{transform:rotate(18deg)}87%{transform:rotate(-9deg)}}
@keyframes lp-twinkle{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.58;transform:scale(.76)}}
@keyframes lp-svg-trail{to{stroke-dashoffset:-108}}
@keyframes lp-particle-up{
  0%{opacity:0;transform:translate(-50%,-50%) rotate(0deg) scale(.35)}
  16%{opacity:1}58%{opacity:1}
  100%{opacity:0;transform:translate(calc(-50% + var(--lp-particle-dx,0px)),calc(-50% + var(--lp-particle-dy,-70px))) rotate(var(--lp-particle-rot,0deg)) scale(1.25)}
}
@media(max-width:640px){
  #lp-mascot-widget{width:190px;height:253px;right:7px;bottom:9px}
  #lp-mascot-widget .lp-mascot__face{width:189px;height:177px;bottom:42px}
  #lp-mascot-widget .lp-mascot__bubble{right:3px;max-width:178px;min-width:145px;font-size:12px;padding:10px 12px}
  #lp-mascot-widget .lp-mascot__tools{right:7px;gap:5px}
  #lp-mascot-widget .lp-mascot__tools button{height:30px;width:30px}
  #lp-mascot-widget .lp-mascot__sleep{font-size:14px}
  #lp-mascot-restore{bottom:12px;right:12px}
}
@media(prefers-reduced-motion:reduce){
  #lp-mascot-widget .lp-mascot__face,#lp-mascot-widget .wing-upper,#lp-mascot-widget .wing-lower,
  #lp-mascot-widget .buddy-arm-left,#lp-mascot-widget .buddy-trail,#lp-mascot-widget .sparkle-twinkle,
  #lp-mascot-effects .lp-mascot-particle{animation:none!important}
  #lp-mascot-widget .lp-mascot__bubble,#lp-mascot-widget .lp-mascot__sleep{transition:none!important}
}
/* Never print the floating character on printable worksheets. */
@media print{#lp-mascot-widget,#lp-mascot-restore,#lp-mascot-effects{display:none!important}}

/* Shared site overlays and menus stay above the floating character. */
#lp-mascot-widget{width:180px;height:244px}
#lp-mascot-widget .lp-mascot__face{width:158px;height:151px;bottom:46px}
#lp-mascot-widget .lp-mascot__bubble{right:2px;min-width:144px;max-width:176px;font-size:12px;padding:10px 12px}
#lp-mascot-widget .lp-mascot__sleep{font-size:14px}
#lp-mascot-widget .lp-mascot__tools{right:6px}
#lp-mascot-widget .lp-mascot__tools button{width:36px;height:36px}
body:has(dialog[open]) #lp-mascot-widget,body:has(dialog[open]) #lp-mascot-restore{visibility:hidden}
@media(max-width:640px){#lp-mascot-widget{width:154px;height:205px}#lp-mascot-widget .lp-mascot__bubble{min-width:130px;max-width:148px}#lp-mascot-widget .lp-mascot__face{width:126px;height:121px;bottom:45px}#lp-mascot-widget .lp-mascot__tools{right:4px;gap:6px}#lp-mascot-widget .lp-mascot__tools button{width:36px;height:36px}}
