/* ==========================================
   ARENA - Экран боя с мобами
   Отдельный файл для лёгкого апгрейда
   ========================================== */

/* ==========================================
   ПЕРЕМЕННЫЕ
   ========================================== */
:root {
    /* Боевая цветовая палитра */
    --arena-bg-primary: #0a0d14;
    --arena-bg-secondary: #111827;
    --arena-bg-gradient: linear-gradient(180deg, #0a0d14 0%, #111827 50%, #1a1f2e 100%);

    /* Акцентные цвета */
    --arena-gold: #ffd700;
    --arena-gold-dark: #b8860b;
    --arena-red: #ef4444;
    --arena-red-dark: #dc2626;
    --arena-green: #22c55e;
    --arena-blue: #3b82f6;
    --arena-purple: #8b5cf6;

    /* HP бар */
    --arena-hp-bg: rgba(0, 0, 0, 0.6);
    --arena-hp-fill: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    --arena-hp-boss: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);

    /* Тени и свечения */
    --arena-glow-gold: 0 0 20px rgba(255, 215, 0, 0.4);
    --arena-glow-red: 0 0 20px rgba(239, 68, 68, 0.4);
    --arena-glow-purple: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* ==========================================
   LOADER
   ========================================== */
.mob-loader {
    font-size: 48px;
    animation: pulse-loader 1s ease-in-out infinite;
}

@keyframes pulse-loader {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ==========================================
   PIXI.JS CANVAS КОНТЕЙНЕР
   ========================================== */

/* Контейнер внутри зоны моба */
.pixi-mob-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    /* Поверх этапов и всех других элементов */
    /* Поверх DOM спрайтов */
    pointer-events: auto;
    overflow: visible;
    /* Не обрезаем моба */
}


.pixi-mob-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Старый контейнер для совместимости */
.pixi-arena-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
}

.pixi-arena-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* DOM элементы поверх Pixi canvas */
.arena-main {
    position: relative;
    z-index: 5;
}

.arena-header {
    z-index: 50;
}

.arena-mob-zone {
    position: relative;
    z-index: 10;
}

/* DOM моб скрыт когда Pixi активен */
.arena-mob {
    position: relative;
    z-index: 2;
}

/* Кликабельные элементы поверх canvas */
.arena-mob-zone .arena-mob-hp-container,
.arena-mob-zone .arena-player-hp-container,
.arena-mob-zone .arena-mob-name {
    pointer-events: none;
    position: relative;
    z-index: 5;
}


/* ==========================================
   ЭКРАН АРЕНЫ
   ========================================== */
#arena-screen {
    background:
        url('../assets/bg-arena.svg') center top / cover no-repeat fixed,
        var(--arena-bg-gradient);
    min-height: 100vh;
    height: 100%;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Прячем скроллбар когда не скроллим */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    /* Фикс для iOS: предотвращаем "схлопывание" контента при скролле */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Запрещаем overscroll (bounce эффект) */
    overscroll-behavior: none;
}

/* Прячем скроллбар в WebKit (Chrome, Safari) */
#arena-screen::-webkit-scrollbar {
    display: none;
}

/* ==========================================
   HEADER АРЕНЫ
   ========================================== */
.arena-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    z-index: 50;
    backdrop-filter: blur(8px);
    /* Фикс для iOS: принудительное GPU-ускорение предотвращает исчезновение */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* ==========================================
   КРУГ УРОВНЯ С XP ПРОГРЕССОМ
   ========================================== */
.arena-level-circle {
    position: relative;
    width: 52px;
    height: 52px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.arena-level-circle:hover {
    transform: scale(1.05);
}

.arena-level-circle:active {
    transform: scale(0.95);
}

.arena-level-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.arena-level-bg {
    fill: none;
    stroke: rgba(255, 215, 0, 0.15);
    stroke-width: 3.5;
}

.arena-level-progress {
    fill: none;
    stroke: var(--arena-gold);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.arena-level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 17px;
    font-weight: 700;
    color: var(--arena-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* ==========================================
   БЛОК РЕСУРСОВ
   ========================================== */
.arena-resources {
    display: flex;
    gap: 12px;
}

.arena-resource {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.arena-resource:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.6);
}

.arena-resource-icon {
    font-size: 18px;
}

.arena-resource-value {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    min-width: 45px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   ПЕРЕКЛЮЧАТЕЛЬ ЗИМНИХ ЭФФЕКТОВ
   ========================================== */
.arena-winter-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.arena-winter-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(135, 206, 235, 0.4);
}

.arena-winter-toggle:active {
    transform: scale(0.95);
}

/* Активное состояние (зимние эффекты включены) */
.winter-effects-enabled .arena-winter-toggle {
    background: rgba(135, 206, 235, 0.2);
    border-color: rgba(135, 206, 235, 0.5);
    box-shadow: 0 0 12px rgba(135, 206, 235, 0.3);
}

/* Неактивное состояние - серый оттенок */
body:not(.winter-effects-enabled) .arena-winter-toggle {
    opacity: 0.6;
    filter: grayscale(0.5);
}

/* ==========================================
   ОСНОВНОЙ КОНТЕНТ АРЕНЫ
   ========================================== */
.arena-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Фикс для iOS: GPU-ускорение предотвращает исчезновение при скролле */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    padding: 600px 16px 120px;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* ==========================================
   КОНТЕЙНЕР ДЛЯ ВИДЖЕТОВ (СЕЗОН + РЕЙТИНГИ)
   ========================================== */
.arena-top-widgets {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
    position: relative;
    z-index: 1;
    /* Ниже чем моб */
}

/* ==========================================
   МИНИ-ВИДЖЕТ СЕЗОННОГО ПРОПУСКА
   ========================================== */
.arena-season-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 0 0 auto;
}

.arena-season-widget:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.arena-season-widget:active {
    transform: scale(0.98);
}

/* ==========================================
   МИНИ-ВИДЖЕТ РЕЙТИНГОВ
   ========================================== */
.arena-leaderboard-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(79, 70, 229, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 0 0 auto;
}

.arena-leaderboard-widget:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.arena-leaderboard-widget:active {
    transform: scale(0.98);
}

.arena-leaderboard-icon {
    font-size: 24px;
}

.arena-leaderboard-info {
    display: flex;
    flex-direction: column;
}

.arena-quests-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(16, 185, 129, 0.25));
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #e5e7eb;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    position: relative;
}

.arena-quests-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

.arena-quests-btn:active {
    transform: translateY(0);
}

/* Анимация подсветки когда есть доступные награды */
.arena-quests-btn.has-rewards {
    animation: quests-glow-pulse 1.5s ease-in-out infinite;
    border-color: rgba(34, 197, 94, 0.6);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.3));
}

.arena-quests-btn.has-rewards::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #111;
    animation: reward-dot-pulse 1s ease-in-out infinite;
}

@keyframes quests-glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.3), 0 4px 12px rgba(59, 130, 246, 0.15);
    }

    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.5), 0 0 30px rgba(34, 197, 94, 0.3), 0 4px 12px rgba(59, 130, 246, 0.15);
    }
}

@keyframes reward-dot-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.arena-leaderboard-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.arena-season-icon {
    font-size: 24px;
}

.arena-season-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arena-season-title {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.arena-season-level {
    font-size: 14px;
    font-weight: 700;
    color: var(--arena-gold);
}

.arena-season-progress {
    width: 60px;
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-left: auto;
}

.arena-season-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--arena-gold), #ffa500);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ==========================================
   ИНДИКАТОР ЭТАПА (10 точек) + УРОВЕНЬ ПОДЗЕМЕЛЬЯ
   ========================================== */
.arena-stage-indicator {
    display: flex;
    flex-direction: row;
    /* В одну строку */
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    /* На всякий случай для маленьких экранов */
    width: 100%;
    margin-bottom: 4px;
}

/* Уровень подземелья */
.arena-dungeon-level {
    font-size: 12px;
    font-weight: 600;
    color: var(--arena-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 12px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 12px;
    margin-bottom: 0px;
    /* Убираем отступ для рядного отображения */
}

.arena-dungeon-level span:last-child {
    font-size: 13px;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.arena-stage-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.arena-stage-dots {
    display: flex;
    gap: 8px;
    /* Чуть меньше гэп */
    padding: 6px 14px;
    /* Меньше паддинг */
    background: rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px) saturate(1.1);
    position: relative;
    overflow: hidden;
}

.arena-stage-dots::before {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    top: 50%;
    height: 8px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.2);
    overflow: hidden;
}

.arena-stage-dots::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    top: 50%;
    height: 8px;
    width: auto;
    transform: translateY(-50%) scaleX(var(--stage-progress-scale, 0));
    transform-origin: left center;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.6), rgba(74, 222, 128, 0.8));
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.arena-stage-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.arena-stage-dot.completed {
    background: var(--arena-green);
    border-color: var(--arena-green);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.arena-stage-dot.current {
    background: var(--arena-gold);
    border-color: var(--arena-gold);
    box-shadow: var(--arena-glow-gold);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.arena-stage-dot.boss {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--arena-purple);
    border-color: var(--arena-purple);
}

.arena-stage-dot.boss.current {
    box-shadow: var(--arena-glow-purple);
    animation: pulse-boss 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        box-shadow: var(--arena-glow-gold);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 24px rgba(255, 215, 0, 0.6);
    }
}

@keyframes pulse-boss {

    0%,
    100% {
        transform: scale(1);
        box-shadow: var(--arena-glow-purple);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 24px rgba(139, 92, 246, 0.7);
    }
}

/* ==========================================
   ЗОНА МОБА
   ========================================== */
.arena-mob-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
    max-width: 320px;
    min-height: 380px;
    /* Уменьшаем высоту контейнера */
    /* Достаточно высоты чтобы моб не обрезался */
    /* Минимальная высота для моба */
    padding: 20px;
    position: relative;
    z-index: 100 !important;
    /* Самый высокий приоритет принудительно */
    margin-top: -15px;
    /* Возвращаем отступ как просили */
    cursor: pointer;
    transition: transform 0.1s ease;
}

/* Hover эффект для зоны атаки */
.arena-mob-zone:active {
    transform: scale(0.98);
}

/* Светящаяся платформа под мобом */
.arena-mob-zone::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    filter: blur(8px);
    top: 50%;
}

.arena-mob {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: mob-idle 2.5s ease-in-out infinite;
    position: relative;
}

/* ==========================================
   АНИМАЦИИ МОБОВ (Diablo-style)
   ========================================== */

/* Покачивание моба - медленное, жуткое */
@keyframes mob-idle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    25% {
        transform: translateY(-4px) rotate(-1.5deg) scale(1.01);
    }

    50% {
        transform: translateY(-8px) rotate(0deg) scale(1.02);
    }

    75% {
        transform: translateY(-4px) rotate(1.5deg) scale(1.01);
    }
}

/* Дыхание/пульсация - для большей жути */
@keyframes mob-breathe {

    0%,
    100% {
        filter:
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4)) drop-shadow(0 16px 32px rgba(0, 0, 0, 0.3));
    }

    50% {
        filter:
            drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5)) drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35));
    }
}

.arena-mob-sprite {
    /* Контейнер подстраивается под контент */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Убрали фиксированный размер и тень - всё на изображении */
    transition: transform 0.15s ease-out;
}

/* SVG/PNG изображение моба */
.mob-sprite-img {
    /* Базовый размер для всех мобов (scale применяется поверх) */
    width: 180px;
    height: 180px;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
    user-select: none;
    /* Делаем мрачнее + многослойная тень */
    filter:
        contrast(1.1) saturate(0.85) brightness(0.9) drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.6)) drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.4));
    transition: transform 0.15s ease-out, filter 0.1s ease-out;
    /* Анимация дыхания на самом изображении */
    animation: mob-breathe 3s ease-in-out infinite;
}

/* Стиль для босса - зловещее свечение + тени, чуть больше размер */
.mob-sprite-img.boss-sprite {
    width: 220px;
    height: 220px;
    filter:
        contrast(1.15) saturate(0.9) brightness(0.85) drop-shadow(0 0 15px rgba(139, 92, 246, 0.5)) drop-shadow(2px 6px 10px rgba(0, 0, 0, 0.6));
}

/* ==========================================
   АНИМАЦИЯ УДАРА (Diablo-style hit)
   ========================================== */
.arena-mob-sprite.hit {
    animation: mob-hit-shake 0.25s ease-out;
}

.arena-mob-sprite.hit .mob-sprite-img {
    animation: mob-hit-flash 0.25s ease-out;
}

/* Резкое откидывание + сжатие при ударе */
@keyframes mob-hit-shake {
    0% {
        transform: translateX(0) translateY(0) scale(1);
    }

    15% {
        transform: translateX(-20px) translateY(-5px) scale(0.92);
    }

    30% {
        transform: translateX(15px) translateY(0) scale(0.95);
    }

    50% {
        transform: translateX(-8px) translateY(-3px) scale(0.97);
    }

    70% {
        transform: translateX(5px) translateY(0) scale(0.99);
    }

    100% {
        transform: translateX(0) translateY(0) scale(1);
    }
}

/* Вспышка при ударе - красноватая, кровавая */
@keyframes mob-hit-flash {
    0% {
        filter: contrast(1.1) saturate(0.85) brightness(0.9);
    }

    20% {
        filter: contrast(1.5) saturate(1.5) brightness(2) sepia(0.3) hue-rotate(-10deg) drop-shadow(0 0 25px rgba(255, 50, 50, 0.8));
    }

    40% {
        filter: contrast(1.3) saturate(0.5) brightness(1.5) drop-shadow(0 0 15px rgba(255, 100, 100, 0.5));
    }

    100% {
        filter: contrast(1.1) saturate(0.85) brightness(0.9);
    }
}

/* ==========================================
   ЭФФЕКТ АТАКИ (Slash/Impact)
   ========================================== */

/* Контейнер для эффектов атаки */
.arena-attack-effect {
    position: absolute;
    top: 35%;
    left: 75%;
    pointer-events: none;
    z-index: 100;
}

/* Слэш - одиночный удар с рандомным углом */
.slash-effect {
    width: 160px;
    height: 8px;
    position: relative;
    border-radius: 4px;
    animation: slash-swing 0.2s ease-out forwards;
    /* Угол задаётся через inline style --angle */
    transform: translate(-50%, -50%) rotate(var(--angle, -30deg)) scaleX(0);
}

/* Обычный урон - белый/серебристый */
.slash-effect.normal {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(200, 200, 220, 0.4) 15%,
            rgba(255, 255, 255, 0.95) 50%,
            rgba(200, 200, 220, 0.4) 85%,
            transparent 100%);
    box-shadow:
        0 0 8px rgba(255, 255, 255, 0.6),
        0 0 15px rgba(200, 200, 255, 0.3);
}

/* Критический урон - красный/огненный */
.slash-effect.crit {
    height: 10px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 80, 50, 0.5) 15%,
            rgba(255, 120, 80, 1) 50%,
            rgba(255, 80, 50, 0.5) 85%,
            transparent 100%);
    box-shadow:
        0 0 12px rgba(255, 100, 50, 0.8),
        0 0 25px rgba(255, 50, 50, 0.5),
        0 0 40px rgba(255, 50, 50, 0.2);
}

/* Сильный урон - золотой */
.slash-effect.strong {
    height: 9px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 180, 50, 0.5) 15%,
            rgba(255, 215, 100, 1) 50%,
            rgba(255, 180, 50, 0.5) 85%,
            transparent 100%);
    box-shadow:
        0 0 10px rgba(255, 200, 50, 0.7),
        0 0 20px rgba(255, 180, 50, 0.4);
}

@keyframes slash-swing {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle, -30deg)) scaleX(0);
        opacity: 1;
    }

    40% {
        transform: translate(-50%, -50%) rotate(var(--angle, -30deg)) scaleX(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle, -30deg)) scaleX(1.1);
        opacity: 0;
    }
}

/* Искры от удара */
.slash-effect .spark {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    animation: spark-fly 0.35s ease-out forwards;
}

.slash-effect.normal .spark {
    box-shadow:
        0 0 6px 2px rgba(255, 255, 255, 0.8),
        0 0 12px 4px rgba(200, 200, 255, 0.4);
}

.slash-effect.crit .spark {
    width: 6px;
    height: 6px;
    background: #ff6644;
    box-shadow:
        0 0 8px 3px rgba(255, 100, 50, 0.9),
        0 0 16px 6px rgba(255, 50, 50, 0.5);
}

.slash-effect.strong .spark {
    background: #ffd700;
    box-shadow:
        0 0 7px 2px rgba(255, 215, 0, 0.8),
        0 0 14px 5px rgba(255, 180, 50, 0.4);
}

@keyframes spark-fly {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) translate(var(--dx, 0), var(--dy, 0)) scale(0);
        opacity: 0;
    }
}

/* ==========================================
   БОСС - усиленные эффекты
   ========================================== */
.arena-mob.boss .arena-mob-sprite {
    animation: boss-idle 3s ease-in-out infinite, boss-aura 2s ease-in-out infinite;
}

.arena-mob.boss .mob-sprite-img {
    /* Размер задан в .mob-sprite-img.boss-sprite */
    filter:
        contrast(1.2) saturate(0.8) brightness(0.8) drop-shadow(0 0 20px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 40px rgba(80, 40, 150, 0.4));
}

/* Покачивание босса - более угрожающее */
@keyframes boss-idle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    20% {
        transform: translateY(-6px) rotate(-2deg) scale(1.02);
    }

    50% {
        transform: translateY(-12px) rotate(0deg) scale(1.04);
    }

    80% {
        transform: translateY(-6px) rotate(2deg) scale(1.02);
    }
}

/* Пульсирующая аура босса */
@keyframes boss-aura {

    0%,
    100% {
        filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 30px rgba(139, 92, 246, 0.3));
    }

    50% {
        filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 1)) drop-shadow(0 0 50px rgba(139, 92, 246, 0.5));
    }
}

/* Удар по боссу - более мощный эффект */
.arena-mob.boss .arena-mob-sprite.hit {
    animation: boss-hit-shake 0.3s ease-out;
}

@keyframes boss-hit-shake {
    0% {
        transform: translateX(0) translateY(0) scale(1);
    }

    10% {
        transform: translateX(-25px) translateY(-8px) scale(0.88);
    }

    25% {
        transform: translateX(20px) translateY(0) scale(0.92);
    }

    45% {
        transform: translateX(-12px) translateY(-4px) scale(0.95);
    }

    65% {
        transform: translateX(8px) translateY(0) scale(0.98);
    }

    85% {
        transform: translateX(-3px) translateY(0) scale(0.99);
    }

    100% {
        transform: translateX(0) translateY(0) scale(1);
    }
}

.arena-mob-name {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    /* Убираем отступы, чтобы прилипло к бару */
    padding: 0 0 1px 0;
    /* Крошечный отступ содержимого */
}


.arena-mob-name.boss-name {
    color: #f5e8ff;
    text-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
    background: none;
    border: none;
}


/* ==========================================
   HP БАР МОБА С БРОНЕЙ
   ========================================== */
.arena-mob-hp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    margin-top: 190px;
    /* Еще ниже (+10px) */
    width: 100%;
    max-width: 200px;
    /* Ширина как у HP бара */
}

.arena-mob-hp-bar {
    width: 100%;
    height: 26px;
    margin-top: 0;
    /* Убираем отступ сверху */
    background: var(--arena-hp-bg);
    border-radius: 14px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.35);
    position: relative;
}

.arena-mob-hp-fill {
    height: 100%;
    background: var(--arena-hp-fill);
    border-radius: 12px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.25);
    position: absolute;
    left: 0;
    top: 0;
}

/* Слой брони поверх HP (серый) */
.arena-mob-armor-fill {
    height: 100%;
    background: linear-gradient(90deg, #6b7280 0%, #9ca3af 100%);
    border-radius: 12px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}

/* Блеск на HP баре */
.arena-mob-hp-fill::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    right: 6px;
    height: 7px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 4px;
}

/* Блеск на броне */
.arena-mob-armor-fill::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    right: 6px;
    height: 7px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    border-radius: 4px;
}

.boss-gear-toast {
    position: fixed;
    transform: translateX(-50%);
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 12px rgba(239, 68, 68, 0.4);
    z-index: 9999;
    opacity: 0;
    animation: boss-gear-toast 2.2s ease forwards;
    pointer-events: none;
}

@keyframes boss-gear-toast {
    0% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -14px);
    }
}

.arena-mob.boss .arena-mob-hp-fill {
    background: var(--arena-hp-boss);
}

/* Контейнер для HP и Брони текста */
.arena-mob-hp-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.arena-mob-hp-text {
    color: rgba(255, 255, 255, 0.8);
}

.arena-mob-armor-text {
    color: rgba(156, 163, 175, 0.9);
}

/* ==========================================
   КНОПКА АТАКИ
   ========================================== */
.arena-attack-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 56px;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    background: linear-gradient(180deg, #ffd700 0%, #e6a800 50%, #cc9500 100%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 20px rgba(255, 215, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

/* Блик на кнопке */
.arena-attack-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.arena-attack-btn:hover::before {
    left: 100%;
}

.arena-attack-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 32px rgba(255, 215, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.arena-attack-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow:
        0 2px 12px rgba(255, 215, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.arena-attack-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.arena-attack-btn:disabled::before {
    display: none;
}

.arena-attack-icon {
    font-size: 26px;
}

/* ==========================================
   ИНФОРМАЦИЯ О НАГРАДЕ
   ========================================== */
.arena-reward-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.arena-reward-amount {
    color: var(--arena-gold);
    font-weight: 600;
}

/* Кнопка бонусов за активность */
.activity-rewards-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.3);
    border: 2px solid rgba(139, 92, 246, 0.5);
    color: #a78bfa;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-rewards-btn:hover {
    background: rgba(139, 92, 246, 0.5);
    border-color: #a78bfa;
    transform: scale(1.1);
}

.activity-rewards-btn.has-reward {
    background: rgba(34, 197, 94, 0.4);
    border-color: #22c55e;
    color: #4ade80;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.activity-rewards-btn.animate-pulse {
    animation: activity-pulse 2s infinite;
}

@keyframes activity-pulse {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    }

    50% {
        box-shadow: 0 0 24px rgba(34, 197, 94, 0.8);
    }
}

/* Кнопка зелий */
.arena-potions-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    border: 2px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.arena-potions-btn:hover {
    background: rgba(16, 185, 129, 0.5);
    border-color: #34d399;
    transform: scale(1.1);
}

.arena-potions-btn:active {
    transform: scale(0.95);
}

/* Potion Flash Effects */
.potion-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    animation: potionFlash 0.5s ease-out;
}

.potion-flash.red {
    background-color: rgba(255, 0, 0, 0.4);
}

/* Rage */
.potion-flash.gray {
    background-color: rgba(128, 128, 128, 0.5);
}

/* Smoke */
.potion-flash.blue {
    background-color: rgba(0, 191, 255, 0.3);
}

/* Shield */
.potion-flash.cyan {
    background-color: rgba(0, 255, 255, 0.3);
}

/* Mirror */
.potion-flash.orange {
    background-color: rgba(255, 165, 0, 0.3);
}

/* Power */
.potion-flash.yellow {
    background-color: rgba(255, 215, 0, 0.3);
}

/* Precision */
.potion-flash.green {
    background-color: rgba(34, 197, 94, 0.3);
}

/* Health */

@keyframes potionFlash {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ==========================================
   МОДАЛКА ЗЕЛИЙ
   ========================================== */
.potions-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.potions-modal-content {
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.potions-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.potions-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.potions-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.potions-modal-close:hover {
    background: rgba(239, 68, 68, 0.4);
}

.potions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.potion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s;
}

.potion-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.potion-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.potion-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.potion-info {
    flex: 1;
    min-width: 0;
}

.potion-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.potion-desc {
    font-size: 11px;
    color: #9ca3af;
}

.potion-count {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.potion-use-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.potion-use-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.potion-use-btn:active {
    transform: scale(0.95);
}

.potion-use-btn:disabled {
    background: #374151;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.potions-empty {
    text-align: center;
    padding: 32px;
    color: #6b7280;
}

.potions-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Анимация воскрешения */
.resurrect-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.6) 0%, rgba(16, 185, 129, 0) 70%);
    z-index: 9999;
    pointer-events: none;
    animation: resurrect-glow 0.8s ease-out forwards;
}

@keyframes resurrect-glow {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}


/* ==========================================
   POPUP НАГРАДЫ
   ========================================== */
.arena-reward-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(14px) saturate(1.1);
    padding: 20px 28px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 100;
    animation: reward-popup 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reward-popup {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.arena-reward-popup h3 {
    font-size: 22px;
    color: #fff;
    margin: 0 0 16px;
    text-align: center;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.35);
}

.arena-reward-popup p {
    font-size: 16px;
    color: #e5e7eb;
    text-align: center;
    margin: 8px 0;
}

/* ==========================================
   АНИМАЦИЯ УРОНА
   ========================================== */
.arena-damage-number {
    position: absolute;
    font-size: 28px;
    font-weight: 800;
    color: var(--arena-red);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(239, 68, 68, 0.5);
    pointer-events: none;
    animation: damage-float 1s ease-out forwards;
    z-index: 60;
}

.arena-damage-number.crit {
    font-size: 40px;
    color: var(--arena-gold);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.7);
}

@keyframes damage-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1.2);
    }

    20% {
        transform: translateY(-10px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.6);
    }
}

/* ==========================================
   АНИМАЦИЯ СМЕРТИ МОБА
   ========================================== */
.arena-mob.dying {
    animation: mob-death 0.6s ease-out forwards;
}

@keyframes mob-death {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    30% {
        transform: scale(1.1);
        filter: brightness(2);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) rotate(15deg);
        filter: brightness(0);
    }
}

/* ==========================================
   ЭФФЕКТ ПОЯВЛЕНИЯ МОБА
   ========================================== */
.arena-mob.spawning {
    animation: mob-spawn 0.5s ease-out forwards;
}

@keyframes mob-spawn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }

    60% {
        transform: scale(1.1) translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ========================================== */
@media (max-width: 400px) {
    .arena-header {
        padding: 10px 12px;
    }

    .arena-level-circle {
        width: 44px;
        height: 44px;
    }

    .arena-level-text {
        font-size: 15px;
    }

    .arena-resources {
        gap: 8px;
    }

    .arena-resource {
        padding: 6px 10px;
    }

    .arena-resource-value {
        font-size: 13px;
        min-width: 35px;
    }

    .arena-mob-sprite {
        width: 100px;
        height: 100px;
    }

    .arena-mob.boss .arena-mob-sprite {
        width: 140px;
        height: 140px;
    }

    .arena-attack-btn {
        padding: 14px 40px;
        font-size: 16px;
    }

    .arena-stage-dots {
        gap: 6px;
    }

    .arena-stage-dot {
        width: 10px;
        height: 10px;
    }
}

/* ==========================================
   iOS ПЛАТФОРМА
   ========================================== */
html[data-platform="ios"] #arena-screen {
    padding-top: 65px;
}

html[data-platform="ios"] .arena-header {
    padding-top: calc(-50px + 70px);
}

html[data-platform="ios"] .arena-main {
    padding-top: calc(50px + 47px);
    padding-bottom: calc(120px + 34px);
}

/* iOS: Оптимизация анимаций */
html[data-platform="ios"] .arena-mob-sprite {
    will-change: transform, filter;
}

html[data-platform="ios"] .arena-attack-btn::before {
    will-change: left;
}

/* ==========================================
   ANDROID ПЛАТФОРМА
   ========================================== */
html[data-platform="android"] #arena-screen {
    padding-top: 0;
}

html[data-platform="android"] .arena-header {
    padding-top: calc(-10px + 24px);
    /* 24px для статус бара Android */
}

html[data-platform="android"] .arena-main {
    padding-top: calc(115px + 24px);
}

/* Android: Отключение тяжёлых эффектов для производительности */
html[data-platform="android"] .arena-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html[data-platform="android"] .arena-resource {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html[data-platform="android"] .arena-level-progress {
    filter: none;
}

html[data-platform="android"] .arena-mob-zone::after {
    display: none;
    /* Убираем blur-эффект платформы */
}

html[data-platform="android"] .arena-attack-btn::before {
    display: none;
    /* Убираем блик на кнопке */
}

html[data-platform="android"] .arena-attack-btn {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

html[data-platform="android"] .arena-stage-dot {
    box-shadow: none;
}

html[data-platform="android"] .arena-stage-dot.current {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

html[data-platform="android"] .arena-stage-dot.boss.current {
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* Android: Упрощённые анимации */
html[data-platform="android"] .arena-mob {
    animation: mob-idle-simple 2s ease-in-out infinite;
}

@keyframes mob-idle-simple {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

html[data-platform="android"] .arena-mob-sprite.hit {
    animation: mob-hit-simple 0.2s ease;
}

@keyframes mob-hit-simple {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-8px);
        filter: brightness(1.5);
    }
}

/* ==========================================
   LITE MODE (слабые устройства)
   ========================================== */
html.lite-mode .arena-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.lite-mode .arena-resource {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.lite-mode .arena-mob-zone::after {
    display: none;
}

html.lite-mode .arena-level-progress {
    filter: none;
}

html.lite-mode .arena-attack-btn::before {
    display: none;
}

html.lite-mode .arena-stage-dot {
    box-shadow: none;
    transition: none;
}

html.lite-mode .arena-mob {
    animation: none;
}

html.lite-mode .arena-damage-number {
    animation: damage-float-simple 0.6s ease-out forwards;
}

@keyframes damage-float-simple {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

/* ==========================================
   HP ИГРОКА (появляется при бое с боссом)
   ========================================== */
.arena-player-hp-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.arena-player-hp-label {
    font-size: 12px;
    font-weight: 600;
    color: #ff6b6b;
    white-space: nowrap;
}

.arena-player-hp-bar {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: hidden;
    min-width: 100px;
    position: relative;
}

.arena-player-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2E7D32);
    border-radius: 6px;
    transition: width 0.3s ease, background 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
}

.arena-player-armor-fill {
    height: 100%;
    background: linear-gradient(90deg, #6b7280 0%, #9ca3af 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.arena-player-hp-text {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 60px;
    text-align: right;
}

.arena-player-armor-text {
    font-size: 11px;
    font-weight: 600;
    color: rgba(156, 163, 175, 0.9);
    min-width: 48px;
    text-align: left;
}

/* ==========================================
   МОДАЛКА ПОРАЖЕНИЯ
   ========================================== */
.arena-death-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.arena-death-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #ff4444;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 0 40px rgba(255, 68, 68, 0.3);
    animation: slideUp 0.3s ease;
}

.arena-death-content h2 {
    font-size: 28px;
    color: #ff4444;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.arena-death-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    line-height: 1.5;
}

.arena-death-timer {
    margin: 20px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.arena-death-timer span {
    color: #ffd700;
    font-size: 13px;
}

.arena-death-close-btn {
    margin-top: 16px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.arena-death-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
}

/* ==========================================
   АНИМАЦИЯ УДАРА БОССА
   ========================================== */
.arena-mob-sprite.boss-attack {
    animation: boss-attack-anim 0.4s ease;
}

@keyframes boss-attack-anim {
    0% {
        transform: scale(1) translateY(0);
    }

    25% {
        transform: scale(1.2) translateY(10px);
    }

    50% {
        transform: scale(1.1) translateY(0);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

/* Урон по игроку - другой цвет */
.arena-damage-number.player-damage {
    color: #ff4444 !important;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.8) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================
   КНОПКИ В МОДАЛКЕ ПОРАЖЕНИЯ
   ========================================== */
.arena-death-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.arena-death-potion-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.arena-death-potion-btn:hover:not(.disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.arena-death-potion-btn.disabled {
    background: linear-gradient(135deg, #666, #444);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================
   ЭФФЕКТ ИСЦЕЛЕНИЯ
   ========================================== */
.arena-heal-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.3);
    pointer-events: none;
    z-index: 9998;
    animation: healFlash 0.5s ease-out forwards;
}

@keyframes healFlash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ==========================================
   ЭФФЕКТ УРОНА (красная вспышка)
   ========================================== */
.arena-damage-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(239, 68, 68, 0.35);
    pointer-events: none;
    z-index: 9998;
    animation: damageFlash 0.4s ease-out forwards;
}

@keyframes damageFlash {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* Текст исцеления - зелёный */
.arena-damage-number.heal {
    color: #4CAF50 !important;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.8) !important;
}

/* Текст ожога - оранжевый */
.arena-damage-number.burn {
    color: #ff8c00 !important;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.8) !important;
}

/* Текст магии - фиолетовый */
.arena-damage-number.magic {
    color: #a855f7 !important;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.8) !important;
    font-size: 32px;
}

/* ==========================================
   ЭФФЕКТЫ МАГИИ
   ========================================== */
.magic-effect {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 70;
    animation: magic-effect-appear 1.5s ease-out forwards;
    pointer-events: none;
}

.magic-effect .magic-icon {
    font-size: 48px;
    animation: magic-icon-pulse 0.5s ease infinite;
}

.magic-effect .magic-text {
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

@keyframes magic-effect-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    30% {
        transform: translate(-50%, -50%) scale(1);
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(0.8);
    }
}

@keyframes magic-icon-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Огненная магия */
.magic-effect.magic-fire .magic-icon {
    color: #ff4500;
    text-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
}

.magic-effect.magic-fire .magic-text {
    color: #ffcc00;
}

/* Ледяная магия */
.magic-effect.magic-ice .magic-icon {
    color: #00bfff;
    text-shadow: 0 0 20px rgba(0, 191, 255, 0.8);
}

.magic-effect.magic-ice .magic-text {
    color: #e0f7fa;
}

/* Молниевая магия */
.magic-effect.magic-lightning .magic-icon {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.magic-effect.magic-lightning .magic-text {
    color: #fff9c4;
}

/* Магия жизни */
.magic-effect.magic-life .magic-icon {
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
}

.magic-effect.magic-life .magic-text {
    color: #bbf7d0;
}

/* ==========================================
   НАГРАДЫ И ТАЙМЕРЫ (UI)
   ========================================== */
.arena-reward-info,
.activity-rewards-btn {
    /* Transform убран, так как будем менять позицию в HTML */
    position: relative;
    z-index: 10;
}

/* ==========================================
   CAPTCHA MODAL
   ========================================== */
.captcha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.captcha-overlay.visible {
    opacity: 1;
}

.captcha-modal {
    background: linear-gradient(145deg, #1a1f2e 0%, #0d1117 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 360px;
    position: relative;
    box-shadow: 
        0 0 60px rgba(139, 92, 246, 0.2),
        0 20px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.captcha-overlay.visible .captcha-modal {
    transform: translateY(0) scale(1);
}

.captcha-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.captcha-header {
    text-align: center;
    margin-bottom: 20px;
}

.captcha-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    animation: captcha-icon-pulse 2s ease-in-out infinite;
}

@keyframes captcha-icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.captcha-header h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.captcha-floor {
    color: var(--arena-gold);
    font-size: 13px;
    font-weight: 500;
}

.captcha-task {
    text-align: center;
    margin-bottom: 20px;
}

.captcha-task p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0 0 12px 0;
}

.captcha-target-sum {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(79, 70, 229, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 16px;
    padding: 10px 24px;
}

.captcha-target-sum .sum-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
}

.captcha-target-sum .sum-value {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.captcha-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.captcha-card {
    width: 60px;
    height: 70px;
    background: linear-gradient(145deg, #2a2f3e 0%, #1e222d 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.captcha-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.captcha-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.captcha-card:hover::before {
    opacity: 1;
}

.captcha-card.selected {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.3), rgba(79, 70, 229, 0.3));
    border-color: var(--arena-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-4px) scale(1.05);
}

.captcha-card.selected::before {
    opacity: 1;
    background: linear-gradient(135deg, transparent 0%, rgba(139, 92, 246, 0.15) 100%);
}

.card-number {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.captcha-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
}

.captcha-selection .selection-label {
    color: rgba(255, 255, 255, 0.6);
}

.captcha-selection .selection-sum {
    color: #fff;
    font-weight: 700;
    font-size: 24px;
    min-width: 40px;
    text-align: center;
    transition: all 0.2s ease;
}

.captcha-selection .selection-sum.correct {
    color: var(--arena-green);
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

.captcha-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--arena-purple), #6366f1);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.captcha-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.captcha-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.captcha-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 16px;
}

.captcha-hint.error {
    color: var(--arena-red);
    animation: captcha-hint-shake 0.3s ease;
}

@keyframes captcha-hint-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.captcha-modal.shake {
    animation: modal-shake 0.5s ease;
}

@keyframes modal-shake {
    0%, 100% { transform: translateX(0) scale(1); }
    20% { transform: translateX(-10px) scale(1); }
    40% { transform: translateX(10px) scale(1); }
    60% { transform: translateX(-6px) scale(1); }
    80% { transform: translateX(6px) scale(1); }
}

.captcha-success {
    text-align: center;
    padding: 40px 20px;
}

.captcha-success .success-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    animation: success-pop 0.5s ease;
}

@keyframes success-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.captcha-success p {
    color: var(--arena-green);
    font-size: 18px;
    font-weight: 600;
}
