/* LUNADROP — большие события: лунный разгон и карты топ-дропа.
   Оба оверлея живут в body поверх всего и живут только во время анимации. */

/* ------------------------------------------------------------ тряска ---- */

/* трясём только сам оверлей: страница под ним всё равно закрыта */
.rushfx.is-shake .rushfx__stage,
.rushfx.is-shake .rushfx__title,
.rushfx.is-shake .rushfx__meta { animation: quake .18s linear infinite; }

@keyframes quake {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-3px, 1px, 0); }
  50%  { transform: translate3d(2px, -2px, 0); }
  75%  { transform: translate3d(-1px, 2px, 0); }
  100% { transform: translate3d(3px, 0, 0); }
}

/* ===================================================== ЛУННЫЙ РАЗГОН ==== */

.rushfx {
  position: fixed; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(12px, 2.4vh, 26px);
  overflow: hidden;
  opacity: 0;
  transition: opacity .28s var(--ease);
  pointer-events: none;
}
.rushfx.is-wake { opacity: 1; }
.rushfx.is-out { opacity: 0; transform: scale(1.06); transition: opacity .42s var(--ease), transform .42s var(--ease); }

.rushfx__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 50% 42%, rgba(255, 47, 147, .16), transparent 70%),
    radial-gradient(90% 90% at 50% 120%, rgba(138, 60, 255, .2), transparent 70%),
    rgba(4, 3, 8, .965);
}

/* звёздное поле */
.rushfx__stars { position: absolute; inset: 0; }
.rushfx__stars i {
  position: absolute;
  width: 2px; height: 2px; border-radius: 50%;
  background: #fff;
  transform: scale(var(--s, 1));
  opacity: .25;
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .95; } }

/* луна восходит из-за нижнего края */
.rushfx__moon {
  position: absolute; left: 50%; bottom: -40%;
  width: 46vmin; height: 46vmin;
  transform: translateX(-50%) scale(.8);
  opacity: 0;
  transition: transform 1.2s var(--ease), opacity .8s var(--ease);
}
.rushfx__moon::before {                /* мягкое сияние без filter — дешевле для GPU */
  content: '';
  position: absolute; inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 47, 147, .4), transparent 62%);
}
.rushfx__moon img { position: relative; width: 100%; height: 100%; }
.rushfx.is-wake .rushfx__moon { opacity: .3; transform: translateX(-50%) translateY(-14%) scale(1); }
.rushfx.is-hit .rushfx__moon { opacity: .5; transform: translateX(-50%) translateY(-22%) scale(1.1); }

/* расходящиеся кольца портала */
.rushfx__rings { position: absolute; inset: 0; display: grid; place-items: center; }
.rushfx__rings i {
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 47, 147, .45);
  opacity: 0;
}
.rushfx.is-run .rushfx__rings i { animation: ringout 1.6s var(--ease) infinite; }
.rushfx.is-run .rushfx__rings i:nth-child(2) { animation-delay: .53s; }
.rushfx.is-run .rushfx__rings i:nth-child(3) { animation-delay: 1.06s; }
@keyframes ringout {
  from { transform: scale(.35); opacity: .75; }
  to   { transform: scale(2.1); opacity: 0; }
}

/* вращающиеся лучи */
.rushfx__beams {
  position: absolute; left: 50%; top: 50%;
  width: 130vmax; height: 130vmax;
  margin: -65vmax 0 0 -65vmax;
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 47, 147, .12) 0deg 6deg, transparent 6deg 18deg);
  will-change: transform;
  opacity: 0;
  transition: opacity .6s;
  animation: beamspin 22s linear infinite;
  transform: translateZ(0);
}
.rushfx.is-run .rushfx__beams { opacity: .35; }
.rushfx.is-again .rushfx__beams { opacity: .7; animation-duration: 5s; }
.rushfx.is-hit .rushfx__beams { opacity: .55; animation-duration: 12s; }
@keyframes beamspin { to { transform: rotate(360deg); } }

/* заголовок */
.rushfx__title { position: relative; text-align: center; z-index: 3; }
.rushfx__title b {
  display: block;
  font: 800 clamp(22px, 4.6vw, 46px)/1 var(--head);
  letter-spacing: .16em;
  background: linear-gradient(100deg, var(--moon), var(--pink-2) 45%, #fff 60%, var(--moon));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 1.6s linear infinite;
  text-shadow: 0 4px 30px rgba(255, 47, 147, .35);
}
@keyframes shine { to { background-position: -220% 0; } }
.rushfx__sub {
  display: block; margin-top: 8px;
  font: 700 11px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase;
  color: var(--tx-2);
}
.rushfx.is-again .rushfx__sub { color: var(--pink-2); animation: subpulse .3s steps(2) infinite; }
@keyframes subpulse { 50% { opacity: .35; } }

/* сцена со скином */
.rushfx__stage { position: relative; z-index: 3; display: grid; place-items: center; }

.rushfx__card {
  position: relative;
  width: min(46vmin, 420px); height: min(34vmin, 300px);
  display: grid; place-items: center;
  border-radius: 22px;
  border: 1px solid var(--rc-45);
  background: radial-gradient(circle at 50% 58%, var(--rc-24), rgba(8, 6, 13, .9) 72%);
  box-shadow: 0 30px 80px -30px #000, inset 0 0 60px -20px var(--rc);
  transition: transform .3s var(--ease-snap), box-shadow .4s;
}
.rushfx__cardglow {
  position: absolute; inset: -30%;
  background: radial-gradient(circle, var(--rc-24), transparent 62%);
  opacity: .8;
}
.rushfx__card img {
  position: relative;
  max-height: 78%; width: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .8));
}
.rushfx__card img.is-in { animation: rushpop .14s var(--ease-snap); }
@keyframes rushpop { from { transform: scale(.82) rotate(-2deg); opacity: .25; } }

.rushfx.is-run .rushfx__card { transform: scale(1.02); }
.rushfx.is-stop .rushfx__card { transform: scale(.96); filter: grayscale(.45) brightness(.8); }
.rushfx.is-again .rushfx__card { animation: cardshake .12s linear infinite; }
@keyframes cardshake {
  0% { transform: translate(-4px, 2px) scale(1.03); }
  50% { transform: translate(5px, -3px) scale(1.05); }
  100% { transform: translate(-2px, -1px) scale(1.03); }
}
.rushfx.is-hit .rushfx__card {
  animation: hitpop .55s var(--ease-snap);
  box-shadow: 0 0 120px -10px var(--rc), inset 0 0 80px -20px var(--rc);
}
@keyframes hitpop {
  0% { transform: scale(.6) rotate(-6deg); }
  55% { transform: scale(1.14) rotate(2deg); }
  100% { transform: scale(1); }
}

/* осколки от удара */
.rushfx__shards { position: absolute; inset: 0; pointer-events: none; }
.rushfx__shards i {
  position: absolute; left: 50%; top: 50%;
  width: 4px; height: 16px; margin: -8px 0 0 -2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #fff, var(--rc));
  opacity: 0;
}
.rushfx__stage.is-burst .rushfx__shards i { animation: shard .9s var(--ease) forwards; }
@keyframes shard {
  from { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  to   { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.3); }
}

/* множитель и цена */
.rushfx__meta {
  position: relative; z-index: 3;
  display: flex; align-items: baseline; gap: 18px;
}
.rushfx__mult {
  font: 800 clamp(30px, 6vw, 62px)/1 var(--mono);
  color: #fff;
  text-shadow: 0 0 34px var(--pink);
}
.rushfx.is-hit .rushfx__mult { animation: multpop .5s var(--ease-snap); color: var(--moon); }
@keyframes multpop { 0% { transform: scale(2.2); opacity: 0; } }
.rushfx__price { font: 700 clamp(16px, 2.6vw, 26px)/1 var(--mono); color: var(--moon); }

/* ударная волна и вспышка */
.rushfx__shock {
  position: absolute; left: 50%; top: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid #fff;
  opacity: 0;
}
.rushfx.is-hit .rushfx__shock { animation: shock .8s var(--ease) forwards; }
@keyframes shock {
  from { opacity: .9; transform: scale(1); }
  to   { opacity: 0; transform: scale(46); border-width: .4px; }
}
.rushfx__flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.rushfx.is-hit .rushfx__flash { animation: hitflash .5s var(--ease) forwards; }
@keyframes hitflash { 0% { opacity: .62; } 100% { opacity: 0; } }

/* ==================================================== КАРТЫ ТОП-ДРОПА === */

.topfx {
  position: fixed; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(18px, 3vh, 38px);
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.topfx.is-in { opacity: 1; }
.topfx.is-out { opacity: 0; transform: scale(1.04); transition: opacity .44s, transform .44s; }

.topfx__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(55% 50% at 50% 45%, rgba(255, 177, 20, .14), transparent 70%),
    rgba(4, 3, 8, .965);
}
.topfx__rays {
  position: absolute; left: 50%; top: 50%;
  width: 130vmax; height: 130vmax; margin: -65vmax 0 0 -65vmax;
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 177, 20, .1) 0deg 5deg, transparent 5deg 16deg);
  will-change: transform;
  animation: beamspin 30s linear infinite;
  transform: translateZ(0);
  opacity: .55;
}

.topfx__title { position: relative; z-index: 3; text-align: center; }
.topfx__title small {
  display: block;
  font: 700 10px/1 var(--mono); letter-spacing: .3em; color: var(--tx-3);
  margin-bottom: 12px;
}
.topfx__title b {
  display: block;
  font: 800 clamp(22px, 4.4vw, 44px)/1 var(--head);
  letter-spacing: .12em;
  background: linear-gradient(100deg, #fff, #ffd45e 40%, #fff 60%, #ffb114);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 2s linear infinite;
  text-shadow: 0 6px 30px rgba(255, 177, 20, .4);
}
.topfx__note {
  display: block; margin-top: 10px;
  font-size: 13px; color: var(--tx-2);
}

.topfx__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.topfx.is-flash .topfx__flash { animation: hitflash .26s var(--ease) forwards; }

/* колода */
.tdeck {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 2vw, 26px);
  flex-wrap: wrap;
  perspective: 1400px;
  padding: 0 16px;
}

.tcard {
  position: relative;
  width: clamp(150px, 20vw, 232px);
  aspect-ratio: 3 / 4.1;
  cursor: pointer;
  animation: dealin .6s var(--ease-snap) backwards;
}
/* пока карта закрыта, она зовёт по ней нажать */
.tcard:not(.is-open):hover { transform: translateY(-8px); }
.tcard:not(.is-open):hover .tcard__back { box-shadow: 0 34px 70px -26px #000, inset 0 0 50px -14px var(--pink); }
.tcard:focus-visible { outline: 2px solid var(--pink); outline-offset: 6px; border-radius: 18px; }
.tcard.is-open { cursor: default; }
@keyframes dealin {
  from { opacity: 0; transform: translateY(70px) translateX(var(--x, 0)) rotate(var(--rot, 0)) scale(.7); }
  to   { opacity: 1; transform: none; }
}

.tcard {
  transition: transform .25s var(--ease-snap);
}
.tcard__inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.6, -.3, .3, 1.35);
  animation: cardfloat 3.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * .25s);
}
@keyframes cardfloat { 50% { translate: 0 -10px; } }
.tcard.is-open .tcard__inner { transform: rotateY(180deg); animation: none; }

.tcard__back, .tcard__face {
  position: absolute; inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  overflow: hidden;
}

.tcard__back {
  display: grid; place-items: center; gap: 14px;
  background:
    radial-gradient(70% 60% at 50% 40%, rgba(255, 47, 147, .25), transparent 70%),
    linear-gradient(160deg, #221a33, #0c0912);
  border: 1px solid #3b3055;
  box-shadow: 0 30px 60px -28px #000, inset 0 0 40px -18px var(--pink);
}
.tcard__back img { width: 46%; filter: drop-shadow(0 0 22px rgba(255, 47, 147, .8)); animation: moonspin 8s linear infinite; }
@keyframes moonspin { to { transform: rotate(360deg); } }
.tcard__rune { font: 800 10px/1 var(--mono); letter-spacing: .32em; color: var(--tx-3); }

.tcard__face {
  transform: rotateY(180deg);
  display: grid; align-content: center; justify-items: center; gap: 4px;
  padding: 16px 12px;
  text-align: center;
  background: linear-gradient(180deg, var(--rc-24), rgba(10, 8, 16, .96) 62%);
  border: 1px solid var(--rc-45);
  box-shadow: 0 30px 70px -28px var(--rc), inset 0 0 50px -22px var(--rc);
}
.tcard__glow {
  position: absolute; inset: -40% -20% auto;
  height: 90%;
  background: radial-gradient(circle, var(--rc-24), transparent 65%);
}
.tcard__rar {
  position: relative;
  font: 800 9px/1 var(--mono); letter-spacing: .22em;
  color: var(--rc);
  margin-bottom: 6px;
}
.tcard__art { position: relative; display: grid; place-items: center; width: 100%; }
.tcard__art img { max-height: clamp(84px, 11vw, 132px); width: auto; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .75)); }
.tcard__face small { position: relative; font: 600 10.5px/1 var(--mono); color: var(--tx-3); letter-spacing: .1em; margin-top: 6px; }
.tcard__face b {
  position: relative;
  font: 700 14px/1.2 var(--body);
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tcard__price { position: relative; font: 800 17px/1 var(--mono); color: var(--moon); margin-top: 6px; }

.tcard.is-open { animation: cardhit .5s var(--ease-snap) .45s both; }
@keyframes cardhit {
  0% { transform: scale(1); }
  45% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.tcard__sparks { position: absolute; inset: 0; pointer-events: none; }
.tcard__sparks i {
  position: absolute; left: 50%; top: 50%;
  width: 3px; height: 14px; margin: -7px 0 0 -1.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #fff, var(--rc));
  opacity: 0;
  animation: shard 1s var(--ease) forwards;
}

@media (max-width: 720px) {
  .tdeck { gap: 10px; }
  .tcard { width: clamp(120px, 40vw, 170px); }
  .rushfx__card { width: 82vw; height: 46vw; }
}

@media (prefers-reduced-motion: reduce) {
  .rushfx *, .topfx * { animation: none !important; transition: none !important; }
}

/* --- карта топ-дропа внутри страницы кейса ---------------------------- */
/* та же карта, что и раньше, только теперь она живёт в ряду результатов,
   поэтому меньше и без парения по вертикали */
.case-won__row { perspective: 1400px; }
.case-won__row .tcard {
  width: clamp(150px, 19vw, 210px);
  align-self: center;
}
.case-won__row .tcard__inner { animation: none; }
.case-won__hint {
  text-align: center;
  font: 700 13px/1 var(--mono);
  letter-spacing: .12em;
  color: var(--pink);
  text-transform: uppercase;
  animation: hintpulse 1.5s ease-in-out infinite;
}
@keyframes hintpulse { 50% { opacity: .45; } }
/* пока карта закрыта, кнопки прячем: на кнопке продажи написана сумма */
.case-won.is-hiding .case-won__acts { opacity: 0; pointer-events: none; }
.case-won__acts { transition: opacity .3s ease; }

/* рубашка прямо в ленте прокрутки */
.rcell--secret {
  background: linear-gradient(160deg, #221a33, #0c0912);
  border-color: #3b3055;
  box-shadow: inset 0 0 40px -18px var(--pink);
}
.rcell--secret img {
  width: 44%; max-height: 62px;
  animation: moonspin 8s linear infinite;
  filter: drop-shadow(0 0 16px rgba(255, 47, 147, .75));
}
.rcell--secret b { color: var(--pink); letter-spacing: .2em; }
