/* Micro Delight Pass — tiny CSS-only player smiles (no new assets) */

/* 1. Companion stretch after long idle */
.micro-delight-stretch,
.companion-scene--idle-stretch [data-cat-room-pet-host],
.companion-scene--idle-stretch [data-cat-mini-pet-host] {
  animation: micro-delight-stretch 1.6s ease-in-out;
}

@keyframes micro-delight-stretch {
  0%, 100% { transform: scaleY(1) translateY(0); }
  25% { transform: scaleY(0.92) translateY(2px); }
  55% { transform: scaleY(1.08) translateY(-4px); }
  75% { transform: scaleY(1.02) translateY(-1px); }
}

/* 2. Rare item hover sparkle */
.micro-delight-sparkle,
.collection-profile-item--rare,
.shop-motivation-rarity--legendary,
.shop-motivation-rarity--mythic,
.shop-motivation-rarity--epic,
.cat-room-shop-card--rare-sparkle {
  position: relative;
}

.micro-delight-sparkle::after,
.collection-profile-item--rare::after,
.shop-motivation-rarity--legendary::after,
.shop-motivation-rarity--mythic::after,
.shop-motivation-rarity--epic::after,
.cat-room-shop-card--rare-sparkle:hover::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
    radial-gradient(circle at 72% 68%, rgba(251, 191, 36, 0.45) 0%, transparent 38%);
  transition: opacity 0.35s ease;
}

.micro-delight-sparkle:hover::after,
.collection-profile-item--rare:hover::after,
.shop-motivation-rarity--legendary:hover::after,
.shop-motivation-rarity--mythic:hover::after,
.shop-motivation-rarity--epic:hover::after,
.cat-room-shop-card--rare-sparkle:hover::after {
  opacity: 1;
  animation: micro-delight-sparkle-twinkle 1.2s ease-in-out;
}

@keyframes micro-delight-sparkle-twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* 3. Daily return anticipation + reveal */
.retention-daily-section--companion.micro-delight-anticipate {
  animation: micro-delight-anticipate 0.9s ease-out;
}

@keyframes micro-delight-anticipate {
  0% { opacity: 0.6; transform: scale(0.98); }
  60% { opacity: 1; transform: scale(1.01); }
  100% { transform: scale(1); }
}

.retention-daily-return.micro-delight-reveal .retention-daily-section {
  animation: micro-delight-section-in 0.45s ease-out both;
}

.retention-daily-return.micro-delight-reveal .retention-daily-section:nth-child(1) { animation-delay: 0.05s; }
.retention-daily-return.micro-delight-reveal .retention-daily-section:nth-child(2) { animation-delay: 0.1s; }
.retention-daily-return.micro-delight-reveal .retention-daily-section:nth-child(3) { animation-delay: 0.15s; }
.retention-daily-return.micro-delight-reveal .retention-daily-section:nth-child(4) { animation-delay: 0.2s; }

@keyframes micro-delight-section-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.retention-daily-section--welcome.micro-delight-welcome {
  animation: micro-delight-welcome 1.2s ease-out;
}

@keyframes micro-delight-welcome {
  0% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  40% { box-shadow: 0 0 18px rgba(52, 211, 153, 0.25); }
  100% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
}

.retention-daily-progress-fill--done {
  animation: micro-delight-progress-done 0.8s ease-out;
}

@keyframes micro-delight-progress-done {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}

/* 4. Collection near-complete */
.collection-profile--near-complete {
  animation: micro-delight-near-complete 2s ease-in-out;
}

.collection-profile--near-complete .collection-profile-category-fill {
  animation: micro-delight-bar-glow 2.4s ease-in-out infinite;
}

@keyframes micro-delight-near-complete {
  0%, 100% { box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
  50% { box-shadow: 0 0 14px rgba(251, 191, 36, 0.2); }
}

@keyframes micro-delight-bar-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

/* 5. Profile milestone celebration */
.identity-profile--has-milestones .identity-milestone-chip {
  animation: micro-delight-milestone-in 0.6s ease-out both;
}

.identity-profile--has-milestones .identity-milestone-chip:nth-child(2) { animation-delay: 0.08s; }
.identity-profile--has-milestones .identity-milestone-chip:nth-child(3) { animation-delay: 0.16s; }

@keyframes micro-delight-milestone-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* 6. Social hub loading complete + tab switch */
.social-hub-panel-loaded {
  animation: micro-delight-panel-in 0.4s ease-out;
}

@keyframes micro-delight-panel-in {
  from { opacity: 0.7; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-social-tab].micro-delight-tab-pulse {
  animation: micro-delight-tab-pulse 0.35s ease-out;
}

@keyframes micro-delight-tab-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.social-online-dot--on {
  animation: micro-delight-online-pulse 2.4s ease-in-out infinite;
}

@keyframes micro-delight-online-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  50% { box-shadow: 0 0 6px rgba(52, 211, 153, 0.55); }
}

/* 7. Empty states breathe */
.retention-empty.micro-delight-breathe {
  animation: micro-delight-breathe 3s ease-in-out infinite;
}

@keyframes micro-delight-breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

/* 8. Button tap delight */
.beta-ui-btn.micro-delight-tap {
  animation: micro-delight-tap 0.28s ease-out;
}

@keyframes micro-delight-tap {
  0% { transform: scale(1); }
  45% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* 9. Shop tab + almost-there shimmer */
.cat-room-shop-panel.micro-delight-tab-flash {
  animation: micro-delight-tab-flash 0.5s ease-out;
}

@keyframes micro-delight-tab-flash {
  0% { opacity: 0.85; }
  100% { opacity: 1; }
}

.shop-motivation-block--almost {
  animation: micro-delight-almost-shimmer 2.8s ease-in-out infinite;
}

@keyframes micro-delight-almost-shimmer {
  0%, 100% { border-color: rgba(251, 191, 36, 0.25); }
  50% { border-color: rgba(251, 191, 36, 0.55); }
}

/* 10. Micro-delight toast accent */
.retention-toast.micro-delight-toast {
  border-color: rgba(192, 132, 252, 0.45);
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.retention-toast-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.3;
}

/* 11. Activity feed fresh rows + toolbar */
.retention-activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.retention-activity-refresh {
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
}

.retention-activity-row--fresh {
  animation: micro-delight-feed-fresh 0.65s ease-out;
}

@keyframes micro-delight-feed-fresh {
  from { opacity: 0.5; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 12. Relationship mini bars */
.retention-relationship-mini-bar {
  height: 4px;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.retention-relationship-mini-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width 0.4s ease;
}

.retention-relationship-mini-bar--warm span {
  background: linear-gradient(90deg, #f472b6, #fb7185);
}

/* 13. Collection all-complete */
.collection-profile--all-complete {
  animation: micro-delight-collection-complete 1.4s ease-out;
}

@keyframes micro-delight-collection-complete {
  0%, 100% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  45% { box-shadow: 0 0 20px rgba(52, 211, 153, 0.28); }
}

.collection-profile-category--complete .collection-profile-category-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

/* 14. Daily goal done section */
.retention-daily-section--done {
  border-color: rgba(74, 222, 128, 0.35);
}

/* 15. Profile save success */
.social-profile-save--ok {
  border-color: rgba(74, 222, 128, 0.5) !important;
}

/* 16. Achievement grid unlock pop */
.social-achievement-card.is-unlocked {
  animation: micro-delight-achievement-unlock 0.5s ease-out;
}

@keyframes micro-delight-achievement-unlock {
  from { transform: scale(0.97); opacity: 0.85; }
  to { transform: scale(1); opacity: 1; }
}
