/* ============================================================
   Общие эффекты игровых комнат: слой частиц, подскоки, встряска,
   появление карточек итога, подсветка активного игрока.
   ============================================================ */
.fx-canvas{position:fixed;inset:0;width:100%;height:100%;z-index:300;pointer-events:none}
.fx-ghost{position:fixed;z-index:299;margin:0;pointer-events:none;will-change:transform,opacity}
.fx-float{position:fixed;z-index:301;transform:translate(-50%,0);pointer-events:none;font-weight:800;letter-spacing:-.02em;text-shadow:0 2px 10px rgba(255,255,255,.9);animation:fxFloat 1.2s cubic-bezier(.2,.7,.3,1) forwards}
@keyframes fxFloat{0%{transform:translate(-50%,6px) scale(.7);opacity:0}18%{transform:translate(-50%,-4px) scale(1.1);opacity:1}100%{transform:translate(-50%,-64px) scale(1);opacity:0}}
.fx-bump{animation:fxBump .5s cubic-bezier(.2,.9,.3,1.5)}
@keyframes fxBump{0%{scale:1}40%{scale:1.4}100%{scale:1}}
.fx-shake{animation:fxShake .42s cubic-bezier(.36,.07,.19,.97)}
@keyframes fxShake{10%,90%{translate:-2px 0}20%,80%{translate:4px 0}30%,50%,70%{translate:-6px 0}40%,60%{translate:6px 0}}

/* Карточки итога и ожидания появляются с подскоком, но позиционирование
   через transform не трогаем — анимируются только scale и opacity. */
.result-card:not(.hidden),.waiting-card,.sea-result:not(.hidden)>div,.mafia-result:not(.hidden)>div{animation:fxCardIn .5s cubic-bezier(.2,.9,.3,1.3)}
@keyframes fxCardIn{0%{scale:.86;opacity:0}100%{scale:1;opacity:1}}
.result-card strong,.waiting-card strong{animation:fxTitleIn .6s cubic-bezier(.2,.9,.3,1.4) .08s both}
@keyframes fxTitleIn{0%{translate:0 10px;opacity:0;scale:.9}100%{translate:0 0;opacity:1;scale:1}}

/* Активный игрок: карточка «дышит» фиолетовым светом. */
.is-turn{animation:fxTurnGlow 1.8s ease-in-out infinite}
@keyframes fxTurnGlow{0%,100%{box-shadow:0 0 0 2px rgba(110,79,245,.45),0 10px 26px rgba(110,79,245,.18)}50%{box-shadow:0 0 0 4px rgba(110,79,245,.25),0 14px 34px rgba(110,79,245,.32)}}

/* Смена цифры счёта — подскок. */
.score-pop{display:inline-block;animation:fxBump .5s cubic-bezier(.2,.9,.3,1.5)}

@media(prefers-reduced-motion:reduce){
  .fx-float,.fx-bump,.fx-shake,.result-card:not(.hidden),.waiting-card,.is-turn,.score-pop,.result-card strong,.waiting-card strong{animation:none!important}
}
