/* ============================================================
   Micro-interactions demo · screen + components
   ============================================================ */
.mi-screen {
  align-items: stretch;
  text-align: left;
  padding: 14px 18px 24px;
  overflow-y: auto;
}
.mi-screen::-webkit-scrollbar { display: none; }

.mi-intro { margin: 14px 0 18px; }
.mi-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  color: #F0CF6A;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.85;
}
.mi-h1 {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.6px;
  line-height: 1.2;
  margin-top: 4px;
}
.mi-sub {
  font-size: 12.5px;
  color: #B6C2E2;
  margin-top: 8px;
  letter-spacing: -0.2px;
  line-height: 1.5;
}

.mi-grid { display: flex; flex-direction: column; gap: 10px; }

.mi-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(6px);
}
.mi-card-head {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
}
.mi-num {
  width: 22px; height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: rgba(240,207,106,0.18);
  border: 1px solid rgba(240,207,106,0.4);
  color: #FFE08A;
  font-size: 11px;
  font-weight: 900;
  display: grid; place-items: center;
}
.mi-card-titles { flex: 1; min-width: 0; }
.mi-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.mi-where {
  font-size: 11px;
  color: #B6C2E2;
  margin-top: 2px;
  letter-spacing: -0.2px;
}
.mi-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 8px 6px;
  background: rgba(0,0,0,0.18);
  border-radius: 10px;
  position: relative;
}

.mi-foot {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(240,207,106,0.06);
  border: 1px solid rgba(240,207,106,0.18);
  border-radius: 12px;
  font-size: 11.5px;
  color: #B6C2E2;
  letter-spacing: -0.2px;
  line-height: 1.55;
}
.mi-foot strong { color: #FFE08A; font-weight: 800; }

.mi-replay {
  margin-top: 10px;
  font-size: 11px;
  color: #B6C2E2;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.2px;
}
.mi-replay:hover { color: #fff; border-color: rgba(255,255,255,0.3); }

/* ===== 1. Pulse glow CTA ===== */
.mi-cta {
  position: relative;
  padding: 14px 28px;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFD56A 0%, #E5B954 100%);
  color: #2A1B05;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.3px;
  border: 1.5px solid #C99A2E;
  box-shadow: 0 4px 0 #9C7A2E, 0 0 30px rgba(255,220,120,0.25);
  cursor: pointer;
  overflow: hidden;
  animation: mi-pulse 2.4s ease-in-out infinite;
}
.mi-cta:hover {
  animation-duration: 1.2s;
  box-shadow: 0 4px 0 #9C7A2E, 0 0 50px rgba(255,220,120,0.6);
}
.mi-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 #9C7A2E, 0 0 30px rgba(255,220,120,0.5); }
.mi-cta-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
  animation: mi-shine 3.5s ease-in-out infinite;
}
@keyframes mi-pulse {
  0%, 100% { box-shadow: 0 4px 0 #9C7A2E, 0 0 24px rgba(255,220,120,0.2); }
  50%      { box-shadow: 0 4px 0 #9C7A2E, 0 0 44px rgba(255,220,120,0.5); }
}
@keyframes mi-shine {
  0%, 60%, 100% { left: -100%; }
  75% { left: 150%; }
}

/* ===== 2. Bounce + sparkle ===== */
.mi-char {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.mi-char-wrap {
  position: relative;
  width: 80px; height: 80px;
  display: grid; place-items: center;
}
.mi-char-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  transition: filter .2s;
}
.mi-char-wrap.bouncing img {
  animation: mi-bounce 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)) drop-shadow(0 0 14px rgba(255,224,138,0.6));
}
@keyframes mi-bounce {
  0%   { transform: translateY(0) scale(1); }
  25%  { transform: translateY(-22px) scale(1.08, 0.94); }
  50%  { transform: translateY(0) scale(1.05, 0.95); }
  65%  { transform: translateY(-10px) scale(1.02, 0.98); }
  80%  { transform: translateY(0) scale(1); }
  100% { transform: translateY(0) scale(1); }
}
.mi-spark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  animation: mi-spark 0.9s ease-out forwards;
  pointer-events: none;
}
@keyframes mi-spark {
  0%   { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0); opacity: 0; }
  20%  { transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -0.4)) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(0.6); opacity: 0; }
}

/* ===== 3. Stagger reveal ===== */
.mi-stagger-wrap {
  display: flex; flex-direction: column; align-items: center;
  width: 100%;
}
.mi-stagger { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 220px; }
.mi-stagger-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  animation: mi-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform: translateY(12px);
}
.mi-stagger-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE08A, #F0CF6A);
}
@keyframes mi-slide-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 4. Heart burst ===== */
.mi-heart {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.mi-heart.liked {
  background: rgba(224, 81, 126, 0.18);
  border-color: rgba(224, 81, 126, 0.45);
  color: #FFB4C8;
}
.mi-heart-icon {
  font-size: 20px;
  display: inline-block;
  transition: transform .15s;
}
.mi-heart.bursting .mi-heart-icon { animation: mi-heart-pulse 0.5s ease-out; }
@keyframes mi-heart-pulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.5); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.mi-mini-heart {
  position: absolute;
  top: 50%; left: 24px;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: #FF7AA0;
  pointer-events: none;
  animation: mi-mini-heart 0.7s ease-out forwards;
}
@keyframes mi-mini-heart {
  0%   { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0.5); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(-44px) scale(1.2); opacity: 0; }
}

/* ===== 5. Stamp press ===== */
.mi-stamps {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
}
.mi-stamp {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1.5px dashed rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s;
}
.mi-stamp.on {
  background: linear-gradient(135deg, #B7E373 0%, #58CC02 100%);
  border: 1.5px solid #46A302;
  color: #fff;
  font-size: 16px;
  animation: mi-stamp-press 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 0 #46A302, 0 0 20px rgba(88, 204, 2, 0.4);
}
@keyframes mi-stamp-press {
  0%   { transform: scale(0.5) rotate(-30deg); opacity: 0; }
  40%  { transform: scale(1.15) rotate(8deg); opacity: 1; }
  70%  { transform: scale(0.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ===== 6. XP gauge ===== */
.mi-xp-wrap {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 8px; width: 100%; max-width: 240px;
}
.mi-xp-bar {
  position: relative;
  height: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
}
.mi-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #F0CF6A 0%, #FFE08A 100%);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255,224,138,0.5);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.mi-xp-shine {
  position: absolute;
  top: 0; bottom: 0;
  width: 24px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  pointer-events: none;
}
.mi-xp-text {
  font-size: 11px;
  color: #B6C2E2;
  text-align: center;
  letter-spacing: -0.2px;
  font-weight: 700;
}
.mi-xp-actions { display: flex; gap: 6px; justify-content: center; }
.mi-xp-actions button {
  padding: 4px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.2px;
}
.mi-xp-actions button:hover { background: rgba(255,255,255,0.14); }

/* ===== 7. Confetti burst ===== */
.mi-confetti-btn {
  position: relative;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF6F8E 0%, #E0517E 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: -0.2px;
  border: 1.5px solid #B23A60;
  box-shadow: 0 3px 0 #B23A60;
  cursor: pointer;
  overflow: visible;
}
.mi-confetti-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #B23A60; }
.mi-conf-particles {
  position: absolute;
  top: 50%; left: 50%;
  pointer-events: none;
}
.mi-conf-piece {
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 12px;
  background: var(--c);
  border-radius: 2px;
  transform-origin: 0 0;
  animation: mi-conf 1.2s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
  animation-delay: var(--delay);
}
@keyframes mi-conf {
  0%   { transform: rotate(var(--a)) translate(0) rotate(0); opacity: 1; }
  100% { transform: rotate(var(--a)) translate(var(--d)) rotate(720deg); opacity: 0; }
}

/* ===== 8. Typewriter ===== */
.mi-type-wrap {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%; max-width: 280px; gap: 8px;
}
.mi-type-bubble {
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.5;
  min-height: 40px;
}
.mi-type-cursor {
  display: inline-block;
  color: #FFE08A;
  animation: mi-blink 0.7s steps(1) infinite;
  font-weight: 400;
}
@keyframes mi-blink {
  50% { opacity: 0; }
}
.mi-type-wrap .mi-replay { align-self: center; }
