/* ==========================================================================
   FF44 ENGLISH — ENGAGEMENT LAYER (QIZIQARLILIK VA HIS QILISH QATLAMI)
   Art Direction: Kinetic Editorial Interactive Experience
   Zero layout thrashing, 60fps GPU Composited, Tier C & Motion Safe
   ========================================================================== */

/* 1. TOUCH & CLICK SPARK PARTICLES */
.engagement-spark {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: sparkFade 450ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes sparkFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0);
  }
}

/* 2. AUDIO & HAPTIC STATUS PILL */
.engagement-sound-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: var(--neo-surface-2, #141722);
  border: 1px solid var(--neo-border, rgba(255, 255, 255, 0.12));
  color: var(--neo-text-secondary, #cbd5e1);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--neo-font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.engagement-sound-toggle:hover {
  border-color: var(--neo-accent, #E2FE52);
  color: var(--neo-text-primary, #fff);
  transform: translateY(-2px);
}
.engagement-sound-toggle.active {
  border-color: var(--neo-accent, #E2FE52);
  color: var(--neo-accent, #E2FE52);
  box-shadow: 0 0 16px var(--neo-accent-glow, rgba(226, 254, 82, 0.25));
}
@media (max-width: 768px) {
  .engagement-sound-toggle {
    bottom: 84px; /* Above mobile bottom bar */
    right: 16px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* 3. HERO "WORD SPARK" & COMPASS (PERMANENTLY REMOVED) */
.hero-spark-game-card,
#hero-word-spark-container,
.journey-scrolly-compass,
.spark-letters-rack,
.spark-letter-tile,
.spark-target-slot {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
}

/* 4. FLIP CARD STYLES (Interactive Curiosity) */
.flip-card-wrapper {
  perspective: 1000px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.flip-card-wrapper.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  position: relative;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: inherit;
}
.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(180deg);
  background: var(--neo-surface-2, #141722);
  border: 1px solid var(--neo-accent, #E2FE52);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}
.flip-trigger-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--neo-text-secondary, #cbd5e1);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-family: var(--neo-font-mono, monospace);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.flip-trigger-btn:hover {
  background: var(--neo-accent, #E2FE52);
  color: #050608;
  border-color: var(--neo-accent, #E2FE52);
}

/* 5. STREAK FLAME EVOLUTION ENGINE */
.streak-flame-icon {
  display: inline-block;
  vertical-align: middle;
  transform-origin: center bottom;
  animation: flameFlicker 1.8s ease-in-out infinite alternate;
}
@keyframes flameFlicker {
  0% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.08, 1.14) rotate(1.5deg); }
  100% { transform: scale(0.96, 0.98) rotate(-0.5deg); }
}
.streak-flame-tier-0 {
  filter: grayscale(1) opacity(0.6);
}
.streak-flame-tier-1 {
  filter: drop-shadow(0 0 6px #F59E0B);
}
.streak-flame-tier-2 {
  filter: drop-shadow(0 0 10px #EF4444) drop-shadow(0 0 4px #F59E0B);
}
.streak-flame-tier-3 {
  filter: drop-shadow(0 0 14px #38BDF8) drop-shadow(0 0 6px #818CF8);
  animation-duration: 1.2s;
}

/* 6. JOURNEY COMPASS (Removed - per UX optimization) */
.journey-scrolly-compass {
  display: none !important;
}

/* 7. EASTER EGG CELEBRATION OVERLAY */
.easter-egg-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  z-index: 100000;
  background: linear-gradient(135deg, #1E1B4B, #0F172A);
  border: 1.5px solid #818CF8;
  color: #fff;
  padding: 14px 24px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(129, 140, 248, 0.4);
  font-family: var(--neo-font-display, sans-serif);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.easter-egg-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 8. REDUCED MOTION SAFEGUARDS */
@media (prefers-reduced-motion: reduce) {
  .streak-flame-icon {
    animation: none !important;
  }
  .engagement-spark {
    display: none !important;
  }
  .flip-card-inner {
    transition: none !important;
  }
}
