/* ===== Œuf Easter Egg progressif (fissuration 1→4, éclosion à 5 visites uniques) ===== */
#easter-egg-container {
  position: fixed;
  right: 14px;
  bottom: 126px;
  z-index: 1250;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

#easter-egg-trigger {
  pointer-events: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.22s ease, filter 0.3s ease;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

#easter-egg-trigger:active {
  transform: scale(0.94);
}

.egg-svg {
  width: 68px;
  height: 78px;
  display: block;
  overflow: visible;
}

/* Badge compact sous l'œuf */
.egg-badge {
  background: rgba(6, 20, 34, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #dff8ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* Bulle d'information lorsqu'on touche l'œuf avant éclosion */
.egg-hint-bubble {
  pointer-events: none;
  max-width: 220px;
  background: rgba(6, 20, 34, 0.94);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #eaf7ff;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 7px 11px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.egg-hint-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== Visibilité progressive des fissures (stades 0 à 4) — partagée widget + popup ===== */
.egg-whole-group {
  display: block;
}

.egg-hatched-group {
  display: none;
}

.egg-crack {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.egg-glow-aura {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Stade 0 : intact */
.egg-visual[data-stage='0'] {
  opacity: 0.92;
}

/* Stade 1 : première petite fissure */
.egg-visual[data-stage='1'] .crack-1 {
  opacity: 1;
}

.egg-visual[data-stage='1'] .egg-glow-aura {
  opacity: 0.14;
}

/* Stade 2 : fissures en ramification */
.egg-visual[data-stage='2'] .crack-1,
.egg-visual[data-stage='2'] .crack-2 {
  opacity: 1;
}

.egg-visual[data-stage='2'] .egg-glow-aura {
  opacity: 0.26;
}

/* Stade 3 : grande fracture transversale + léger frémissement */
.egg-visual[data-stage='3'] .crack-1,
.egg-visual[data-stage='3'] .crack-2,
.egg-visual[data-stage='3'] .crack-3 {
  opacity: 1;
}

.egg-visual[data-stage='3'] .egg-glow-aura {
  opacity: 0.42;
}

.egg-visual[data-stage='3'] .egg-svg {
  animation: eggTrembleSoft 3.4s ease-in-out infinite;
}

/* Stade 4 : très fissuré, prêt à éclore ! */
.egg-visual[data-stage='4'] .crack-1,
.egg-visual[data-stage='4'] .crack-2,
.egg-visual[data-stage='4'] .crack-3,
.egg-visual[data-stage='4'] .crack-4 {
  opacity: 1;
}

.egg-visual[data-stage='4'] .egg-glow-aura {
  opacity: 0.72;
}

.egg-visual[data-stage='4'] {
  filter: drop-shadow(0 0 14px rgba(255, 242, 117, 0.55));
}

.egg-visual[data-stage='4'] .egg-svg {
  animation: eggAboutToHatch 1.7s ease-in-out infinite;
}

.egg-visual[data-stage='4'] .egg-badge {
  border-color: #ffb020;
  color: #ffe299;
}

/* ===== Stade 5 : ŒUF ÉCLOS (cliquable pour découvrir l'Easter Egg) ===== */
.egg-visual[data-stage='5'] .egg-whole-group {
  display: none;
}

.egg-visual[data-stage='5'] .egg-hatched-group {
  display: block;
}

.egg-visual[data-stage='5'] {
  animation: eggHatchedFloat 2.1s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(0, 230, 118, 0.6));
}

#easter-egg-trigger[data-stage='5']:hover {
  transform: scale(1.09);
}

.egg-visual[data-stage='5'] .hatch-top-cap {
  transform-origin: 66px 34px;
  animation: capBob 2.1s ease-in-out infinite;
}

.egg-visual[data-stage='5'] .hatch-surprise {
  animation: surprisePop 2.1s ease-in-out infinite;
}

.egg-visual[data-stage='5'] .hatch-sparkles {
  animation: sparklePulse 1.5s ease-in-out infinite;
}

.egg-visual[data-stage='5'] .egg-badge {
  background: linear-gradient(135deg, #00e676 0%, #00e5ff 100%);
  border-color: #ffffff;
  color: #041d15;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.55);
}

/* Secousse tactile lorsqu'on clique avant l'éclosion */
#easter-egg-trigger.egg-nudge .egg-svg {
  animation: eggTapNudge 0.42s ease !important;
}

@keyframes eggTrembleSoft {
  0%, 78%, 100% {
    transform: rotate(0deg);
  }
  83% {
    transform: rotate(-4deg);
  }
  89% {
    transform: rotate(4deg);
  }
  94% {
    transform: rotate(-2deg);
  }
}

@keyframes eggAboutToHatch {
  0%, 55%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  62% {
    transform: translateY(-2px) rotate(-6deg);
  }
  70% {
    transform: translateY(-3px) rotate(6deg);
  }
  78% {
    transform: translateY(-2px) rotate(-5deg);
  }
  86% {
    transform: translateY(0) rotate(4deg);
  }
}

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

@keyframes capBob {
  0%, 100% {
    transform: translate(3px, -5px) rotate(18deg);
  }
  50% {
    transform: translate(5px, -10px) rotate(25deg);
  }
}

@keyframes surprisePop {
  0%, 100% {
    transform: translateY(1px);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes sparklePulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes eggTapNudge {
  0%, 100% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(-11deg) scale(1.04);
  }
  45% {
    transform: rotate(10deg) scale(1.04);
  }
  70% {
    transform: rotate(-6deg);
  }
  88% {
    transform: rotate(4deg);
  }
}

@media (max-width: 480px) {
  #easter-egg-container {
    right: 10px;
    bottom: 118px;
  }

  .egg-svg {
    width: 60px;
    height: 70px;
  }
}
