/* ============================================================
   Mascotte Lili
   ============================================================ */

#mascot-root {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9994;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.3, 1.4, .5, 1);
}
#mascot-root.visible {
  opacity: 1;
  transform: translateY(0);
}

.mascot-char {
  width: 88px;
  height: 100px;
  cursor: pointer;
  animation: mascot-idle 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
  position: relative;
  outline: none;
}
.mascot-char:hover { animation-duration: 1.2s; }
.mascot-char:focus-visible { outline: 3px solid var(--c-yellow); outline-offset: 4px; border-radius: 8px; }
.mascot-char svg { width: 100%; height: 100%; display: block; }

@keyframes mascot-idle {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-4px) rotate(-2deg); }
}

.mascot-bubble {
  background: #fff;
  color: var(--c-ink);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  max-width: 280px;
  font-family: var(--font-body);
  font-size: .9rem;
  line-height: 1.5;
  box-shadow: 0 8px 20px rgba(30, 75, 95, .18);
  border: 2px solid var(--c-yellow);
  position: relative;
  animation: mascot-bubble-in .4s ease;
}
@keyframes mascot-bubble-in {
  from { opacity: 0; transform: translateY(4px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mascot-bubble kbd {
  background: var(--c-cream-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: .85em;
}
.mascot-bubble strong { color: var(--c-coral); font-weight: 800; }

.mascot-close {
  position: absolute;
  top: -6px;
  left: 90px;
  width: 22px;
  height: 22px;
  background: var(--c-coral);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.mascot-close:hover { background: var(--c-teal-dark); }

/* Dark mode : bulle plus sombre */
html.theme-dark .mascot-bubble {
  background: #1a2a38;
  color: #e8e8ee;
  border-color: var(--c-yellow);
}

/* Retro : bulle en papier */
html.theme-retro .mascot-bubble {
  background: #f4ecd8;
  border-color: #6b5830;
  box-shadow: 4px 4px 0 #6b5830;
  border-radius: 6px;
}

@media (max-width: 640px) {
  #mascot-root { bottom: 150px; left: 12px; }
  .mascot-char { width: 64px; height: 76px; }
  .mascot-bubble { max-width: 200px; font-size: .82rem; padding: 10px 12px; }
  .mascot-close { left: 66px; }
}

@media print {
  #mascot-root { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-char { animation: none !important; }
}
