/* --- КОНТЕЙНЕР ДЛЯ ВСЕХ ЭФФЕКТОВ --- */
#vfx-layer-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* ========================================= */
/* === ЭФФЕКТ: ЗАМОРОЗКА (FREEZE) === */
/* ========================================= */
.vfx-freeze-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998; /* Чуть ниже воскрешения */
    pointer-events: none;

    /* СТАТИЧНЫЙ ФОН */
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(150, 220, 255, 0.3) 80%,
        rgba(100, 200, 255, 0.8) 100%
    );

    /* Эффекты */
    backdrop-filter: blur(4px) brightness(1.1) hue-rotate(190deg);
    mix-blend-mode: hard-light;

    /* Анимации */
    animation:
        freeze-shiver 0.1s infinite,
        ice-pulse 3s ease-in-out infinite alternate;
}

.vfx-freeze-overlay::before {
    content: ""; position: absolute; inset: -10px;
    background-image:
        radial-gradient(4px 4px at 100px 50px, #fff, transparent),
        radial-gradient(6px 6px at 200px 150px, #fff, transparent),
        radial-gradient(3px 3px at 300px 250px, #fff, transparent);
    background-size: 500px 500px;
    animation: snow-storm 2s linear infinite;
    opacity: 0.7;
}

.vfx-freeze-overlay::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(45deg, transparent 0, transparent 10px, rgba(255, 255, 255, 0.15) 10px, rgba(255, 255, 255, 0.3) 12px);
    opacity: 0.4;
}

@keyframes freeze-shiver {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, 2px); }
    50% { transform: translate(-2px, 0); }
    75% { transform: translate(0, -2px); }
    100% { transform: translate(0, 0); }
}

@keyframes ice-pulse {
    0% { box-shadow: inset 0 0 50px 20px rgba(100, 200, 255, 0.3); opacity: 0.8; transform: scale(1); }
    100% { box-shadow: inset 0 0 400px 100px rgba(0, 150, 255, 0.9); opacity: 1; transform: scale(1.02); }
}

@keyframes snow-storm {
    0% { background-position: 0 0; }
    100% { background-position: 100px 500px; }
}


/* ========================================= */
/* === ЭФФЕКТ: ВОСКРЕШЕНИЕ (RESURRECT) === */
/* ========================================= */

.vfx-resurrect-wrapper {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,100,0,0.3) 0%, transparent 70%);
    animation: resurrectFade 4s ease-in-out forwards;
}

@keyframes resurrectFade {
    0% { opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; }
}

.resurrect-flames {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to top, rgba(255,100,0,0.8) 0%, transparent 100%);
    filter: blur(20px);
    animation: flameWave 2s infinite ease-in-out;
}

@keyframes flameWave {
    0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.8; }
    50% { transform: translateY(-50px) scaleY(1.3); opacity: 1; }
}

.resurrect-flash {
    position: absolute; top: 50%; left: 50%; width: 300px; height: 300px;
    background: radial-gradient(circle, white 0%, #ffeb3b 30%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: flashBurst 4s ease-in-out;
}

@keyframes flashBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
    35% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.8); }
    50% { opacity: 0; transform: translate(-50%, -50%) scale(3); }
    100% { opacity: 0; }
}

.heart-container-fx {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 200px; color: #ff1744;
    text-shadow: 0 0 30px #ff5722, 0 0 60px #ff9800, 0 0 90px #ff1744;
    perspective: 1000px;
    animation: heart3DSpinAndRise 4s ease-in-out forwards;
}

.heart-container-fx i {
    display: block;
    animation: heart3DRotation 4s ease-in-out forwards;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

@keyframes heart3DSpinAndRise {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1.8); filter: brightness(1.5); }
    25% { transform: translate(-50%, -50%) scale(1.4); filter: brightness(2.5); }
    40% { transform: translate(-50%, -50%) scale(1.6); filter: brightness(3); }
    55% { transform: translate(-50%, -50%) scale(1.3); filter: brightness(2); }
    100% { opacity: 0; transform: translate(-50%, -150vh) scale(4); filter: brightness(1); }
}

@keyframes heart3DRotation {
    0% { transform: rotateY(0deg); }
    10% { transform: rotateY(360deg); }
    25% { transform: rotateY(720deg); }
    40% { transform: rotateY(1440deg); }
    55% { transform: rotateY(1800deg); }
    100% { transform: rotateY(1800deg); }
}

/* Частицы и Искры */
.resurrect-particles {
    position: absolute; width: 100%; height: 100%;
}

.particle {
    position: absolute; width: 8px; height: 8px;
    background: radial-gradient(circle, #ffeb3b 0%, #ff9800 50%, #f44336 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px #ff5722;
    opacity: 0;
    animation: particleRise 3s ease-out forwards;
}

@keyframes particleRise {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    20% { opacity: 1; transform: translateY(80vh) scale(1.5); }
    100% { opacity: 0; transform: translateY(-100px) scale(0); }
}

.spark {
    position: absolute; width: 10px; height: 10px;
    background: #fff;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkFly 3s ease-out forwards;
}

@keyframes sparkFly {
    0% { opacity: 1; transform: scale(0) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0) rotate(720deg); }
}

/* Утилитный класс */
.hidden { display: none !important; }

/* === ЭФФЕКТ: ЩИТ ПУЗЫРЬ === */
.has-bubble-shield {
    border-color: #06b6d4 !important;
    box-shadow:
        0 0 25px rgba(6, 182, 212, 0.9),
        inset 0 0 30px rgba(6, 182, 212, 0.6) !important;
    position: relative;
    overflow: visible !important; /* Разрешаем выход за границы */
    z-index: 50 !important;
    animation: shieldFloat 3s ease-in-out infinite;
}

/* Сам пузырь */
.has-bubble-shield::before {
    content: '';
    position: absolute;
    /* Делаем круг больше карточки */
    top: -15px; left: -15px; right: -15px; bottom: -15px;
    border-radius: 20px;
    border: 3px solid rgba(165, 243, 252, 0.8);
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 70%, transparent 100%);
    pointer-events: none;
    animation: bubblePulse 2s infinite ease-in-out;
    z-index: 100;
}

@keyframes bubblePulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; border-color: rgba(165, 243, 252, 1); }
    100% { transform: scale(1); opacity: 0.8; }
}

/* === ЭФФЕКТ: ПЕЧАТЬ ЖИЗНИ (ПРОКЛЯТИЕ) === */
.player-card.has-life-seal,
.boss-player-card.has-life-seal {
    /* Темно-фиолетовая рамка и внутренняя тень (аура проклятия) */
    border-color: #7c3aed !important; /* Violet-600 */
    box-shadow:
        0 0 15px rgba(124, 58, 237, 0.7),
        inset 0 0 40px rgba(0, 0, 0, 0.8) !important;
    position: relative;
    /* overflow не трогаем или ставим visible, чтобы иконка могла торчать */
    overflow: visible !important;
}

/* Иконка разбитого сердца в углу */
.player-card.has-life-seal::before,

/* Убираем старую решетку (псевдоэлемент after) */
.player-card.has-life-seal::after,
.boss-player-card.has-life-seal::after {
    content: none;
}

/* === ВИЗУАЛЬНОЕ ОТКЛЮЧЕНИЕ ХП === */
/* Находим текст ХП внутри проклятой карты и меняем его стиль */
.player-card.has-life-seal .hp-val,
.boss-player-card.has-life-seal .bp-hp {
    color: #a78bfa !important; /* Бледный фиолетовый вместо красного */
    text-decoration: line-through; /* Зачеркиваем */
    opacity: 0.8;
}
.player-card.has-life-seal .fa-heart,
.boss-player-card.has-life-seal .fa-heart {
    color: #5b21b6 !important; /* Иконку сердца делаем темной */
}

@keyframes curseFloat {
    0% { transform: translateY(0) rotate(10deg); }
    50% { transform: translateY(-5px) rotate(-10deg); }
    100% { transform: translateY(0) rotate(10deg); }
}

/* ========================================= */
/* === ЭФФЕКТ: НЕУЯЗВИМОСТЬ (INVINCIBLE) === */
/* ========================================= */

.vfx-invincible-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9990;

    /* ИЗМЕНЕНО: Градиент начинается с 80% (было 60%), и цвета более прозрачные */
    background: radial-gradient(
        circle,
        transparent 80%,
        rgba(255, 215, 0, 0.1) 90%,
        rgba(255, 223, 0, 0.4) 100%
    );

    /* ИЗМЕНЕНО: Тень меньше и прозрачнее */
    box-shadow: inset 0 0 30px 10px rgba(255, 215, 0, 0.3);
    mix-blend-mode: screen;

    opacity: 0;
    transition: opacity 0.5s ease;
    animation: invinciblePulse 3s infinite ease-in-out; /* Медленнее пульсация */
}

.vfx-invincible-overlay.active {
    opacity: 1;
}

@keyframes invinciblePulse {
    /* ИЗМЕНЕНО: Пульсация теперь слабее */
    0% { box-shadow: inset 0 0 30px 5px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: inset 0 0 50px 15px rgba(255, 255, 100, 0.5); }
    100% { box-shadow: inset 0 0 30px 5px rgba(255, 215, 0, 0.2); }
}

/* (Остальной код shield-block-flash без изменений) */
.vfx-shield-block-flash {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,215,0,0) 70%);
    border-radius: 50%;
    z-index: 10000;
    pointer-events: none;
    animation: shieldBlockPop 0.6s ease-out forwards;
}

@keyframes shieldBlockPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ========================================= */
/* === ЭФФЕКТ: ЗВОН КОЛЕЦ (SONIC RINGS) ==== */
/* ========================================= */

.vfx-flying-coin-anim {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    font-size: 2rem;

    z-index: 999999 !important;
    pointer-events: none !important;

    transform-style: preserve-3d;
    will-change: transform, opacity;

    /* Жесткое мигание, как в старых аркадах */
    animation: vfx-coin-blink 0.15s infinite alternate;
}

@keyframes vfx-coin-blink {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5)) brightness(1);
    }
    100% {
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1)) brightness(1.8);
    }
}

/* ========================================= */
/* === ЭФФЕКТ: СВЕТОШУМОВАЯ ГРАНАТА ======== */
/* ========================================= */

.vfx-flashbang-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 9999999; /* Выше вообще всего, даже рулетки и оверлеев */
    pointer-events: none; /* Разрешаем кликать сквозь белизну */
    animation: flashbangFade 5s ease-out forwards;
}

@keyframes flashbangFade {
    0% { opacity: 1; }
    15% { opacity: 1; } /* Держим абсолютно белый экран почти секунду */
    100% { opacity: 0; } /* Очень медленно прозреваем */
}

/* ========================================= */
/* === ЭКЗОТИЧЕСКАЯ СФЕРА (ЯРОСТЬ) === */
/* ========================================= */
.exotic-orb-wrapper {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px; /* Чуть увеличили для солидности */
    height: 44px;
    border-radius: 50%;
    z-index: 20;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); /* Пружинистый ховер */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.exotic-orb-wrapper.cursor-pointer:hover {
    transform: translateX(-50%) scale(1.15);
}

/* ИМЕННО ЭТО ИСПРАВЛЯЕТ "КВАДРАТ" */
.exotic-orb-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden; /* Обрезает жидкость по кругу */
    z-index: 1;
    background: radial-gradient(circle at 50% 10%, #374151, #111827); /* Глубокий темный фон */
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.8);
}

/* Эффект магмы / плазмы */
.exotic-orb-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 20%, #7f1d1d 100%);
    box-shadow: 0 -2px 8px rgba(239, 68, 68, 0.9), inset 0 3px 6px rgba(255, 255, 255, 0.4);
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Светлая каёмка жидкости (эффект объема) */
.exotic-orb-fill::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: rgba(255, 255, 255, 0.5);
    filter: blur(1px);
}

/* Металлическое кольцо */
.exotic-orb-ring {
    position: absolute;
    inset: -2px; /* Выходит за пределы маски */
    border: 3px solid transparent;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7280, #1f2937, #030712) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.orb-ready::before {
    content: "";
    position: absolute;
    inset: -10px; /* Выходим за края кольца */
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 152, 0, 0.8) 0%, rgba(239, 68, 68, 0.5) 40%, transparent 70%);
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: ringBurn 1s infinite alternate ease-in-out;
}

@keyframes ringBurn {
    0% {
        transform: scale(0.9) rotate(0deg);
        opacity: 0.6;
        filter: blur(4px);
    }
    100% {
        transform: scale(1.2) rotate(15deg);
        opacity: 1;
        filter: blur(6px);
    }
}

/* Состояние: ГОТОВО (100%) */
.orb-ready .exotic-orb-ring {
    background: linear-gradient(135deg, #fef08a, #ef4444, #7f1d1d) border-box;
    animation: exoticOrbPulse 1.5s infinite alternate ease-in-out;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.5), 0 0 10px #ff9800;
}

.orb-ready .exotic-orb-inner {
    box-shadow: inset 0 0 15px #ef4444; /* Внутреннее свечение */
}

@keyframes exoticOrbPulse {
    0% { filter: drop-shadow(0 0 5px rgba(255, 152, 0, 0.6)); }
    100% { filter: drop-shadow(0 0 15px rgba(239, 68, 68, 1)) brightness(1.3); }
}

.exotic-orb-fire {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ff9800; /* Ярко-оранжевый цвет огня */
    z-index: 3;
    animation: fireFloat 0.6s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 6px #ef4444) drop-shadow(0 0 2px #fef08a);
}

@keyframes fireFloat {
    0% { transform: translateY(1px) scale(0.9); }
    100% { transform: translateY(-1px) scale(1.15); }
}

/* --- АКТИВНАЯ ЯРОСТЬ НА КАРТОЧКЕ --- */
.is-enraged {
    animation: enrageShake 0.4s infinite !important; /* Уменьшена скорость */
    border-color: #dc2626 !important;
    box-shadow: 0 0 35px rgba(220, 38, 38, 0.6), inset 0 0 25px rgba(220, 38, 38, 0.3) !important;
}

.is-enraged .card-nick {
    color: #fca5a5 !important;
    text-shadow: 0 0 8px #ef4444;
}

/* Мягкая, менее "нервная" тряска */
@keyframes enrageShake {
    0% { transform: translate(0px, 0px) rotate(0deg); }
    25% { transform: translate(-0.5px, 0.5px) rotate(-0.5deg); }
    50% { transform: translate(0.5px, -0.5px) rotate(0.5deg); }
    75% { transform: translate(-0.5px, -0.5px) rotate(0deg); }
    100% { transform: translate(0px, 0px) rotate(0deg); }
}

/* ========================================= */
/* === ЭФФЕКТ: НЕВИДИМОСТЬ (INVISIBLE) === */
/* ========================================= */

/* Для самого игрока: карта становится полупрозрачной и призрачной */
.is-invisible-self {
    opacity: 0.6 !important;
    filter: grayscale(30%);
    border: 2px dashed #9ca3af !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2) !important;
}

/* Для остальных игроков: карточка превращается в тень (статистика и аватар скрыты) */
.is-invisible-other * {
    opacity: 0 !important; /* Прячем все внутренности (ХП, СП, имя, аватарку) */
}

.is-invisible-other {
    background: rgba(17, 24, 39, 0.8) !important; /* Темный фон */
    border: 2px dashed rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
    pointer-events: none !important; /* Нельзя кликнуть */
}

/* Надпись-заглушка вместо карты */
.is-invisible-other::before {
    content: '👻 Скрыт в тенях';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    opacity: 1 !important; /* Делаем текст видимым */
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
}

/* ========================================= */
/* === ЭФФЕКТ: ЧЕРНИЛА (INK SACK) ========== */
/* ========================================= */

.vfx-ink-container {
    position: fixed;
    inset: 0;
    z-index: 9998; /* Поверх игры, но под глобальными алертами */
    pointer-events: none; /* Чтобы клики проходили сквозь чернила */
    overflow: hidden;
}

.vfx-ink-splatter {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    filter: drop-shadow(0px 8px 12px rgba(0,0,0,0.6));
}