/* =====================================================================
   RÉFÉRENCES - effets des easter eggs « culture » de js/eggs/
   ---------------------------------------------------------------------
   Among Us, Creeper, Oof, Hadoken, Petit Prince, Nyan, ranger de
   l'espace, fusée à damier, ISS et Daft Punk. Tous les dessins sont
   faits maison (hommages, aucune image officielle).
   ===================================================================== */

/* ---------- Outils communs (js/eggs/decor.js) ---------- */
.decor { position: fixed; z-index: 940; pointer-events: none; }

main.secousse { animation: secousse var(--duree-secousse, 600ms) linear; }

@keyframes secousse {
  0%, 100% { translate: 0 0; }
  15% { translate: -9px 4px; }
  30% { translate: 8px -5px; }
  45% { translate: -6px -3px; }
  60% { translate: 5px 4px; }
  75% { translate: -3px 2px; }
}

.flash-explosion {
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #fff, rgba(255, 255, 255, 0.6) 40%, rgba(255, 255, 255, 0));
  animation: flash 0.8s ease-out both;
}

@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Among Us : écran d'éjection ---------- */
.amongus-voile {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.6rem;
  overflow: hidden;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent),
    radial-gradient(1px 1px at 85% 65%, #fff, transparent),
    radial-gradient(1px 1px at 10% 75%, #fff, transparent),
    rgba(2, 3, 10, 0.97);
  color: #fff;
  font-family: var(--police-titre);
  text-align: center;
  cursor: pointer;
  animation: voile-entree 0.6s ease both;
}

.amongus-voile.fermeture { animation: voile-sortie 0.5s ease both; }

@keyframes voile-entree { from { opacity: 0; } }
@keyframes voile-sortie { to { opacity: 0; } }

.amongus-equipier {
  position: absolute;
  top: 28%;
  left: 0;
  width: 90px;
  animation: equipier-derive 7.5s linear both;
}

.amongus-equipier svg { display: block; width: 100%; animation: equipier-tourne 3s linear infinite; }

@keyframes equipier-derive {
  from { transform: translateX(-120px); }
  to { transform: translateX(calc(100vw + 40px)); }
}

@keyframes equipier-tourne { to { rotate: 360deg; } }

.amongus-texte {
  min-height: 1.4em;
  margin: 18vh 1rem 0;
  font-size: clamp(1.2rem, 4vw, 2.1rem);
  font-weight: 500;
}

.amongus-restant {
  margin: 0;
  font-size: clamp(0.95rem, 2.6vw, 1.3rem);
  color: #cfd5e4;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.amongus-voile.fin-texte .amongus-restant { opacity: 1; }

/* ---------- Creeper : le pseudo tremble avant d'exploser ---------- */
.constellation.creeper-tremble { animation: creeper-tremble 0.12s linear infinite; }

@keyframes creeper-tremble {
  0%, 100% { translate: 0 0; scale: 1; }
  50% { translate: 2px -1px; scale: 1.02; }
}

/* ---------- Oof : la photo tombe en morceaux, puis réapparaît ---------- */
.oof-morceaux { position: fixed; z-index: 940; pointer-events: none; }

.oof-morceaux span {
  position: absolute;
  background-repeat: no-repeat;
  animation: oof-chute 1.6s cubic-bezier(0.3, 0, 0.7, 1) both;
}

@keyframes oof-chute {
  0% { transform: none; opacity: 1; }
  25% { transform: translate(calc(var(--dx) * 0.4), var(--haut)) rotate(calc(var(--rot) * 0.25)); }
  100% { transform: translate(var(--dx), 70vh) rotate(var(--rot)); opacity: 0; }
}

.avatar.respawn { animation: respawn 0.9s cubic-bezier(0.3, 1.6, 0.5, 1); }

@keyframes respawn {
  0% { scale: 0; opacity: 0; box-shadow: 0 0 0 30px rgba(120, 200, 255, 0.6); }
  60% { opacity: 1; }
  100% { scale: 1; }
}

/* ---------- Hadoken ---------- */
.hadoken-cri {
  left: 6vw;
  top: 36vh;
  font: italic 900 clamp(2.4rem, 9vw, 5.5rem) var(--police-titre);
  letter-spacing: 0.02em;
  color: #fff;
  -webkit-text-stroke: 2px #1565c0;
  text-shadow: 0 0 18px #42a5f5, 4px 4px 0 #0d47a1;
  animation: hadoken-cri 1.7s ease-out both;
}

@keyframes hadoken-cri {
  0% { opacity: 0; transform: scale(2.2) skewX(-12deg); }
  15% { opacity: 1; transform: scale(1) skewX(-12deg); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(40px) skewX(-12deg); }
}

.hadoken-boule {
  left: 0;
  top: calc(50vh - 45px);
  animation: hadoken-vol 1.15s cubic-bezier(0.4, 0, 0.9, 0.6) both;
}

.hadoken-boule span {
  display: block;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 50%, #fff 0 18%, #b3e5fc 30%, #29b6f6 55%, rgba(41, 182, 246, 0) 72%);
  box-shadow: -40px 0 40px rgba(41, 182, 246, 0.55), -90px 0 60px rgba(41, 182, 246, 0.3);
  animation: hadoken-pulse 0.12s linear infinite alternate;
}

@keyframes hadoken-vol {
  from { transform: translateX(-100px) scale(0.5); }
  20% { transform: translateX(10vw) scale(1); }
  to { transform: translateX(105vw) scale(1.1); }
}

@keyframes hadoken-pulse { to { scale: 1.12; } }

.hadoken-impact {
  right: 0;
  top: calc(50vh - 120px);
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 100% 50%, rgba(255, 255, 255, 0.95), rgba(79, 195, 247, 0.6) 35%, rgba(79, 195, 247, 0) 70%);
  animation: flash 0.65s ease-out both;
}

/* ---------- Le Petit Prince : l'astéroïde B612 traverse le ciel ---------- */
.asteroide-b612 {
  top: 9vh;
  left: 0;
  width: 130px;
  z-index: -1;
  animation: b612-passage 13s linear both;
}

.asteroide-b612 svg { display: block; width: 100%; animation: b612-balance 4s ease-in-out infinite; }

@keyframes b612-passage {
  from { transform: translate(calc(100vw + 20px), 0); }
  to { transform: translate(-160px, 6vh); }
}

@keyframes b612-balance {
  0%, 100% { rotate: -6deg; }
  50% { rotate: 6deg; }
}

/* ---------- Nyan : le chat et son arc-en-ciel ---------- */
.nyan {
  left: 0;
  top: 30vh;
  width: 74px;
  height: 74px;
  animation: nyan-vol 7.2s linear both;
}

.nyan img {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.5);
  animation: nyan-saut 0.4s steps(2) infinite;
}

.nyan-arc {
  position: absolute;
  right: 50%;
  top: 14px;
  width: 100vw;
  height: 46px;
  background: linear-gradient(#ff3b30 0 16.6%, #ff9500 0 33.3%, #ffcc00 0 50%, #34c759 0 66.6%, #0a84ff 0 83.3%, #af52de 0);
  animation: nyan-saut 0.4s steps(2) infinite reverse;
}

.nyan i {
  position: absolute;
  left: calc(-40px - var(--i) * 55px);
  top: calc(-24px + (var(--i) * 37px) % 110px);
  color: #fff;
  font-style: normal;
  animation: nyan-scintille 0.5s steps(2) infinite;
  animation-delay: calc(var(--i) * -0.13s);
}

@keyframes nyan-vol {
  from { transform: translateX(-90px); }
  to { transform: translateX(calc(200vw + 100px)); }
}

@keyframes nyan-saut { 50% { translate: 0 -5px; } }
@keyframes nyan-scintille { 50% { opacity: 0.2; scale: 0.6; } }

/* ---------- Vers l'infini : le ranger s'éloigne dans le ciel ---------- */
.ranger {
  left: 0;
  top: 0;
  width: 170px;
  animation: ranger-vol 4.8s cubic-bezier(0.35, 0, 0.6, 1) both;
}

.ranger svg { position: relative; display: block; width: 100%; overflow: visible; }
.ranger-flamme { animation: flamme 0.08s steps(2) infinite; }

.ranger-trainee {
  position: absolute;
  right: 80%;
  top: 46%;
  width: 60vw;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 210, 0.7));
  filter: blur(1px);
}

@keyframes ranger-vol {
  from { transform: translate(-200px, 78vh) rotate(-16deg) scale(1.1); opacity: 1; }
  80% { opacity: 1; }
  to { transform: translate(92vw, 4vh) rotate(-24deg) scale(0.15); opacity: 0; }
}

@keyframes flamme { 50% { opacity: 0.65; transform: scaleX(0.85); } }

/* ---------- Objectif Lune : la fusée à damier décolle ---------- */
.fusee-lune { left: 14vw; bottom: 0; width: 80px; }

.fusee-corps {
  width: 80px;
  transform: translateY(190px);
  animation: fusee-decollage 5.2s cubic-bezier(0.55, 0, 0.85, 0.5) both;
}

.fusee-corps svg { display: block; width: 100%; overflow: visible; }
.fusee-flamme { transform-origin: 30px 134px; animation: flamme 0.07s steps(2) infinite; }

@keyframes fusee-decollage {
  0% { transform: translateY(190px); }
  12% { transform: translateY(40px) translateX(-2px); }
  16% { transform: translateY(36px) translateX(2px); }
  22% { transform: translateY(30px); }
  100% { transform: translateY(-120vh); }
}

/* Nuage de fumée au pied de la fusée */
.fusee-fumee { position: absolute; left: -40px; bottom: -30px; width: 160px; height: 60px; }

.fusee-fumee i {
  position: absolute;
  left: calc(var(--i) * 20px);
  bottom: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(220, 225, 235, 0.75);
  animation: fumee 3.2s ease-out both;
  animation-delay: calc(0.5s + var(--i) * 0.08s);
}

@keyframes fumee {
  0% { opacity: 0; scale: 0.3; }
  25% { opacity: 0.9; }
  100% { opacity: 0; scale: 2.6; translate: calc((var(--i) - 3) * 18px) -40px; }
}

/* ---------- L'ISS passe, derrière le contenu ---------- */
.iss {
  left: 0;
  top: 0;
  width: 92px;
  z-index: -1;
  animation: iss-passage 15s linear both;
}

.iss svg { display: block; width: 100%; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35)); }
.iss-feu { animation: iss-feu 1.2s steps(1) infinite; }

@keyframes iss-passage {
  from { transform: translate(-120px, 12vh) rotate(8deg); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  to { transform: translate(calc(100vw + 40px), 42vh) rotate(14deg); opacity: 0; }
}

@keyframes iss-feu { 50% { opacity: 0; } }

/* ---------- One more time : la rave passe à l'or ---------- */
html.daft:not(.retro) {
  --accent: #e8c26a;
  --accent-2: #f5e6b8;
}

html.daft .rave-lumieres::before,
html.daft .rave-lumieres::after {
  background: conic-gradient(transparent 0 8deg, rgba(255, 210, 110, 0.3) 9deg 12deg, transparent 13deg 38deg,
    rgba(255, 240, 190, 0.22) 39deg 41deg, transparent 42deg 70deg, rgba(230, 170, 70, 0.26) 71deg 75deg,
    transparent 76deg 110deg, rgba(255, 225, 150, 0.2) 111deg 113deg, transparent 114deg 360deg);
}
