.ach-confetti-piece{
  position:absolute;
  top:-10px;
  width:8px;
  height:14px;
  opacity:0;
  animation-name:ach-confetti-fall;
  animation-timing-function:cubic-bezier(.25,.46,.45,.94);
  animation-fill-mode:forwards;
}
@keyframes ach-confetti-fall{
  0%{opacity:1;transform:translateY(0) rotate(0deg);}
  100%{opacity:0;transform:translateY(70dvh) rotate(540deg);}
}

/* Лучи — только у легендарной. */
.ach-rays{display:none;}

/* ── Легендарная (legendary, pingo_one): золото, лучи, искры вверх ── */
#achCelebrateOverlay[data-rarity="legendary"]{
  --ach-gold:224 184 74;
  background:radial-gradient(circle at 50% 45%, rgb(var(--ach-gold)/.22), rgb(var(--c-bg)/.94) 60%);
}
#achCelebrateOverlay[data-rarity="legendary"] .ach-rays{display:block;}
#achCelebrateOverlay[data-rarity="legendary"] .ach-rays span{
  position:absolute;
  left:50%;top:45%;
  width:160vmax;height:160vmax;
  margin:-80vmax 0 0 -80vmax;
  background:repeating-conic-gradient(rgb(var(--ach-gold)/.16) 0deg 7deg, transparent 7deg 24deg);
  -webkit-mask-image:radial-gradient(circle, #000 0, transparent 45%);
          mask-image:radial-gradient(circle, #000 0, transparent 45%);
  animation:ach-rays-spin 24s linear infinite, ach-fade-in 1.2s ease-out both;
}
#achCelebrateOverlay[data-rarity="legendary"] .ach-card{
  border-color:rgb(var(--ach-gold)/.85);
  box-shadow:0 0 0 1px rgb(var(--ach-gold)/.35), 0 0 60px rgb(var(--ach-gold)/.35), 0 24px 70px rgba(0,0,0,.55);
  animation:ach-card-rise .9s cubic-bezier(.2,.9,.25,1.15) both;
}
#achCelebrateOverlay[data-rarity="legendary"] img.ach-icon{
  animation:ach-halo 2.6s ease-in-out .9s infinite;
}
#achCelebrateOverlay[data-rarity="legendary"] span.ach-icon{
  filter:drop-shadow(0 0 14px rgb(224 184 74 / .8));
}
#achCelebrateOverlay[data-rarity="legendary"] #achCelebrateTier{
  color:rgb(var(--c-or));
  font-weight:700;
}
#achCelebrateOverlay[data-rarity="legendary"] .ach-next{
  background:linear-gradient(135deg, rgb(var(--ach-gold)), rgb(var(--c-or)));
}
.ach-ember{
  position:absolute;
  bottom:-12px;
  width:6px;height:6px;
  border-radius:9999px;
  opacity:0;
  background:rgb(255 214 120);
  box-shadow:0 0 10px 2px rgb(224 184 74 / .8);
  animation-name:ach-ember-rise;
  animation-timing-function:ease-out;
  animation-fill-mode:forwards;
}
@keyframes ach-ember-rise{
  0%{opacity:0;transform:translate(0,0) scale(.6);}
  15%{opacity:1;}
  100%{opacity:0;transform:translate(var(--drift,0px),-85dvh) scale(1.1);}
}
@keyframes ach-rays-spin{to{transform:rotate(360deg);}}
@keyframes ach-fade-in{from{opacity:0;}to{opacity:1;}}
@keyframes ach-card-rise{
  0%{opacity:0;transform:translateY(40px) scale(.85);}
  100%{opacity:1;transform:none;}
}
@keyframes ach-halo{
  0%,100%{box-shadow:0 0 0 4px rgb(224 184 74 / .45), 0 0 18px 4px rgb(224 184 74 / .25);}
  50%{box-shadow:0 0 0 6px rgb(224 184 74 / .7), 0 0 36px 10px rgb(224 184 74 / .45);}
}

/* ── Секретная (Kryptonite): тёмный «сейф» в любой теме, кислотно-зелёный,
   иконка проявляется из силуэта ── */
#achCelebrateOverlay[data-rarity="secret"]{
  --ach-kr:159 232 0;
  background:radial-gradient(circle at 50% 45%, rgb(var(--ach-kr)/.14), transparent 55%), rgb(5 8 6/.96);
}
#achCelebrateOverlay[data-rarity="secret"] .ach-card{
  background:rgb(12 18 12);
  border-color:rgb(var(--ach-kr)/.6);
  color:rgb(226 240 214);
  box-shadow:0 0 0 1px rgb(var(--ach-kr)/.2), 0 0 44px rgb(var(--ach-kr)/.22), 0 24px 70px rgba(0,0,0,.6);
  animation:ach-fade-in 1.4s ease-out both;
}
#achCelebrateOverlay[data-rarity="secret"] .ach-heading{color:rgb(var(--ach-kr));}
#achCelebrateOverlay[data-rarity="secret"] #achCelebrateTitle{
  color:rgb(236 250 220);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#achCelebrateOverlay[data-rarity="secret"] #achCelebrateTier,
#achCelebrateOverlay[data-rarity="secret"] #achCelebrateCounter{color:rgb(var(--ach-kr)/.75);}
#achCelebrateOverlay[data-rarity="secret"] #achCelebrateDesc{color:rgb(190 208 178);}
#achCelebrateOverlay[data-rarity="secret"] #achCelebrateClose{color:rgb(var(--ach-kr)/.7);}
#achCelebrateOverlay[data-rarity="secret"] .ach-icon{
  animation:ach-reveal 2.2s cubic-bezier(.6,0,.3,1) .3s both;
}
#achCelebrateOverlay[data-rarity="secret"] img.ach-icon{
  box-shadow:0 0 0 4px rgb(159 232 0 / .45), 0 0 24px 4px rgb(159 232 0 / .3);
}
#achCelebrateOverlay[data-rarity="secret"] .ach-next{
  background:rgb(var(--ach-kr));
  color:rgb(10 16 6);
}
.ach-spore{
  position:absolute;
  width:4px;height:4px;
  border-radius:9999px;
  opacity:0;
  background:rgb(159 232 0);
  box-shadow:0 0 8px 1px rgb(159 232 0 / .7);
  animation-name:ach-spore-drift;
  animation-timing-function:ease-in-out;
  animation-iteration-count:infinite;
}
@keyframes ach-spore-drift{
  0%{opacity:0;transform:translate(0,0);}
  30%,70%{opacity:.8;}
  100%{opacity:0;transform:translate(var(--drift,0px),-60px);}
}
@keyframes ach-reveal{
  0%{filter:brightness(0) blur(10px);}
  60%{filter:brightness(.35) blur(3px);}
  100%{filter:none;}
}

@media(prefers-reduced-motion:reduce){
  .ach-confetti-piece,.ach-ember,.ach-spore{animation:none;opacity:0;}
  #achCelebrateOverlay .ach-rays span,
  #achCelebrateOverlay .ach-card,
  #achCelebrateOverlay .ach-icon{animation:none;}
}
