/* ===================== SABIE — STYLES (sprites PNG) ===================== */

.sabie {
  display: inline-block;
  position: relative;
  pointer-events: none;
  will-change: transform;
}
.sabie-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(139, 92, 246, 0.35));
  user-select: none;
  -webkit-user-drag: none;
}

/* Tailles — basées sur le ratio ~3:4 des sprites */
.sabie.size-xs { width: 56px;  height: 76px;  }
.sabie.size-sm { width: 88px;  height: 118px; }
.sabie.size-md { width: 130px; height: 174px; }
.sabie.size-lg { width: 180px; height: 240px; }
.sabie.size-xl   { width: 240px; height: 320px; }
.sabie.size-hero { width: 220px; height: 358px; }   /* ratio natif du sprite hero */

/* Positionnement */
.sabie.fixed-tr  { position: fixed; top: 68px; right: 8px; z-index: 5; }
.sabie.center    { display: block; margin: 0 auto; }

/* Aura mauve derrière le sprite */
.sabie::before {
  content: '';
  position: absolute;
  inset: -15% -15% -10% -15%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(139, 92, 246, 0.25) 35%, transparent 65%);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

/* Scintilles autour de Sabie */
.sabie-sparkle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fcd34d 0%, #f59e0b 60%, transparent 100%);
  pointer-events: none;
  opacity: 0.85;
  filter: blur(0.5px);
}
.sabie-sparkle.violet { background: radial-gradient(circle, #c084fc 0%, #9333ea 60%, transparent 100%); }

/* Fallback CSS animation (avant JS) */
@keyframes sabieFallbackFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.sabie:not(.js-ready) .sabie-img {
  animation: sabieFallbackFloat 3s ease-in-out infinite;
}

/* ===================== BULLE BD ===================== */
.sabie-bubble {
  display: inline-block;
  position: relative;
  background: #ffffff;
  color: #1a1126;
  border-radius: 22px;
  padding: 12px 18px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  max-width: 280px;
  box-shadow:
    0 12px 32px -8px rgba(0,0,0,0.45),
    0 2px 8px rgba(0,0,0,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.06);
  border: 3px solid #1a1126;
  z-index: 10;
}

/* Queue de la bulle pointant vers le bas (Sabie en dessous) */
.sabie-bubble.point-down::before {
  content: '';
  position: absolute;
  bottom: -16px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 18px solid #1a1126;
}
.sabie-bubble.point-down::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 14px solid #ffffff;
}

/* Queue pointant vers la gauche (Sabie à gauche) */
.sabie-bubble.point-left::before {
  content: '';
  position: absolute;
  left: -16px; top: 24px;
  width: 0; height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 18px solid #1a1126;
}
.sabie-bubble.point-left::after {
  content: '';
  position: absolute;
  left: -10px; top: 26px;
  width: 0; height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-right: 14px solid #ffffff;
}

/* Animation d'apparition */
@keyframes bubblePop {
  0% { opacity: 0; transform: scale(0.6) translateY(8px); }
  60% { opacity: 1; transform: scale(1.06) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.sabie-bubble {
  animation: bubblePop 480ms cubic-bezier(.34,1.56,.64,1) both;
  transform-origin: 50% 100%;
}

/* Variantes de tons */
.sabie-bubble.tone-good { color: #15803d; }
.sabie-bubble.tone-bad  { color: #be185d; }
