@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Bungee&family=Bungee+Inline&family=Bungee+Shade&family=Monoton&family=Luckiest+Guy&family=Russo+One&family=Nunito:wght@400;700;900&display=swap');

/* --- База --- */
body {
    font-family: 'Nunito', sans-serif;
    background-color: #241436;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px; /* Размер клетки */
    color: #333;
    overflow: hidden; /* Важно, чтобы не было скролла */
    margin: 0;
    padding: 0;

    /* АНИМАЦИЯ ФОНА (ПАРАЛЛАКС) */
    animation: bg-scroll 1s linear infinite;
}

@keyframes bg-scroll {
    from { background-position: 0 0; }
    to { background-position: -40px -40px; }
}

h1, h2, .arcade-font {
    font-family: 'Press Start 2P', cursive; /* Пиксельный шрифт */
    text-transform: uppercase;
    line-height: 1.4;
    letter-spacing: 2px;
}

.christmas-font {
    font-family: 'Press Start 2P', cursive !important;
}

/* --- ARCADE UI KIT --- */

/* 1. Аркадная панель (для окон входа, лобби) */
.arcade-panel {
    background-color: #ffffff;
    border: 4px solid #000000;
    box-shadow: 8px 8px 0px 0px #000000; /* Жесткая тень */
    border-radius: 8px; /* Чуть скругленные углы, но не овал */
}

/* 2. Аркадная кнопка (с эффектом нажатия) */
.arcade-btn {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    color: #fff;
    border: 3px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
    transition: all 0.1s;
    position: relative;
    top: 0;
}

.arcade-btn:active {
    top: 4px; /* Кнопка физически опускается */
    box-shadow: 0px 0px 0px 0px #000000; /* Тень исчезает */
}

/* Цвета кнопок */
.btn-red { background-color: #ef4444; }
.btn-red:hover { background-color: #dc2626; }

.btn-yellow { background-color: #fbbf24; color: #000; }
.btn-yellow:hover { background-color: #f59e0b; }

.btn-blue { background-color: #3b82f6; }
.btn-blue:hover { background-color: #2563eb; }

/* 3. Поле ввода */
.arcade-input {
    border: 3px solid #000000;
    background-color: #f3f4f6;
    box-shadow: inset 4px 4px 0px rgba(0,0,0,0.1); /* Внутренняя тень */
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
}
.arcade-input:focus {
    background-color: #fff;
    outline: none;
}

/* --- Эффекты --- */
.candy-shadow {
    /* Жесткая тень вместо размытой */
    box-shadow: 6px 6px 0px 0px #000000;
    border: 4px solid #000000;
}

.card-hover {
    transition: all 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-5px) scale(1.02);
}

.fade-anim {
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Загрузка аватара --- */
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #16a34a;
    background-color: #f3f4f6;
}

/* --- Скроллбар --- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
    background: #d42426;
    border-radius: 5px;
}

/* --- СТИЛИ ИГРОВОЙ КАРТОЧКИ --- */
.player-card {
    width: 220px;
    height: 320px;

    /* Светло-серый фон, нейтральный */
    background: #f0f0f0;
    border-radius: 12px;

    /* Яркая рамка (синяя по умолчанию) */
    border: 4px solid #3b82f6;

    /* Жесткая тень для объема */
    box-shadow: 6px 6px 0px rgba(0,0,0,0.3);

    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    position: relative;
    margin: 0 auto;
    transition: transform 0.1s;
}

#intermission-content {
    transition: opacity 0.2s ease-in-out;
}

/* 2. Убрали эффект наведения (hover), оставили только смену курсора */
.player-card:hover {
    cursor: default;
    /* transform и border-color убраны */
}

/* 3. ЗОЛОТАЯ РАМКА ДЛЯ СЕБЯ */
.gold-border {
    border-color: #facc15 !important; /* Желтый */
    background: #fffbeb;
    box-shadow: 6px 6px 0px rgba(161, 98, 7, 0.4) !important;
    transform: translateY(-4px); /* Чуть приподнята */
}

/* --- ОБНОВЛЕННЫЙ БЕЙДЖ УРОВНЯ --- */
.level-badge {
    position: absolute;
    top: -20px; /* Подняли выше, чтобы не лезло на лицо */
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 100px;
    z-index: 30; /* Выше всех элементов карточки */
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: help;
}

.level-svg {
    width: 65px;
    height: 65px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    display: block;
}

/* Фоновый шестиугольник */
.hex-bg {
    fill: #0f172a; /* Глубокий темный */
    stroke: #1e40af; /* Тусклый синий для контура */
    stroke-width: 6;
}

/* Зеленое кольцо (Прогресс) */
.hex-progress {
    fill: none;
    stroke: #22c55e; /* Яркий зеленый */
    stroke-width: 6;
    stroke-linecap: round;
    /* Магия процентов */
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Число уровня в центре */
.level-num {
    position: absolute;
    top: 32px; /* Центрируем внутри SVG */
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
    z-index: 35;
    pointer-events: none;
}

/* Текст опыта под бейджем */
.xp-text {
    margin-top: 2px;
    background: rgba(0, 0, 0, 0.85);
    color: #4ade80;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid #22c55e;
    white-space: nowrap;

    /* Прячем по умолчанию */
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Показываем при наведении на весь бейдж */
.level-badge:hover .xp-text {
    opacity: 1;
    transform: translateY(0);
}

/* --- СТИЛИ ДЛЯ БОЕВОГО ПРОПУСКА (УРОВНЕЙ) --- */
.bp-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin: 0;
    flex-shrink: 0; /* <--- ДОБАВИТЬ ЭТО */
}

/* Сам кружок/шестиугольник уровня */
.bp-node {
    width: 60px;
    height: 60px;
    background: #1e293b;
    border: 4px solid #475569;
    border-radius: 16px; /* Закругленный квадрат/гекс */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #94a3b8;
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

/* Контейнер для линии между уровнями */
.bp-line-container {
    position: relative;
    width: 10px;
    height: 80px;
    background: #334155;
    margin: 0 auto;
    border-radius: 5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    flex-shrink: 0; /* <--- ДОБАВИТЬ ЭТО */
}

/* Заполненная часть линии (растет снизу вверх) */
.bp-line-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #3b82f6, #60a5fa);
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    transition: height 1s ease-out;
}

/* Текст опыта прямо на линии */
.bp-xp-label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-family: monospace;
    font-weight: 900;
    color: #60a5fa;
    background: rgba(15, 23, 42, 0.8);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #3b82f6;
    white-space: nowrap;
}

/* Карточка награды сбоку */
.bp-reward {
    position: absolute;
    left: calc(50% + 50px);
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid #334155;
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* --- СОСТОЯНИЯ --- */

/* Пройденный уровень */
.bp-node.completed {
    background: #2563eb;
    border-color: #60a5fa;
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Текущий уровень (Анимация пульсации) */
.bp-node.current {
    background: #eab308;
    border-color: #fef08a;
    color: #422006;
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.6);
    animation: bpCurrentPulse 2s infinite alternate;
}

@keyframes bpCurrentPulse {
    0% { filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.4)); }
    100% { filter: drop-shadow(0 0 20px rgba(234, 179, 8, 0.9)); }
}

/* Если награда получена */
.bp-reward.claimed {
    opacity: 0.5;
    filter: grayscale(100%);
}

.bp-reward.claimed::after {
    content: "✓ ПОЛУЧЕНО";
    position: absolute;
    top: -8px;
    right: -10px;
    background: #22c55e;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Аватарка (увеличили под размер карты) */
.card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    object-fit: cover;
    margin-top: 30px;
    background-color: #eee;
}

/* Никнейм */
.card-nick {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.6rem; /* Крупнее шрифт */
    font-weight: bold;
    color: #1f2937;
    margin-top: 15px;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Линия-разделитель */
.card-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #d1d5db, transparent);
    margin-top: auto;
    margin-bottom: 10px;
}

/* Блок статов */
.card-stats {
    width: 100%;
    background-color: #f3f4f6;
    border-radius: 10px;
    padding: 8px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.1rem; /* Крупнее цифры */
    border: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
}

.hp-val { color: #dc2626; }
.sp-val { color: #2563eb; }
.stat-badge-coins {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #facc15;
}

.stat-separator {
    width: 2px;
    height: 20px;
    background-color: #9ca3af;
}

.player-card.eliminated {
    background: #2a0a0a; /* Темно-кровавый фон */
    border-color: #450a0a;
    box-shadow: none;
    opacity: 0.8;
    transform: scale(0.95) !important; /* Чуть меньше */
}

.player-card.eliminated .card-nick {
    color: #ef4444; /* Красный текст */
    text-decoration: line-through;
}

.player-card.eliminated .card-avatar {
    filter: grayscale(100%) contrast(120%);
    border-color: #7f1d1d;
}

/* Штамп "ВЫБЫЛ" */
.eliminated-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 4px solid #ef4444;
    color: #ef4444;
    font-size: 2rem;
    font-weight: 900;
    padding: 5px 15px;
    border-radius: 10px;
    opacity: 0.8;
    z-index: 20;
    pointer-events: none;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Оверлей наблюдателя в игре */
.spectator-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 50; /* Поверх игры */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 100px;
    pointer-events: auto; /* Блокирует клики по игре */
}

.spectator-text {
    font-family: 'Mountains of Christmas', cursive;
    color: #ef4444;
    font-size: 3rem;
    text-shadow: 0 0 10px black;
    background: rgba(0,0,0,0.7);
    padding: 10px 30px;
    border-radius: 15px;
    border: 2px solid #ef4444;
}

/* --- СТИЛИ ГЛОБАЛЬНЫХ РЕЗУЛЬТАТОВ --- */

.res-winner-border {
    border-color: #ffd700 !important; /* Золотая рамка */
    background: linear-gradient(to bottom, #fffbeb, #fff);
}

.res-loser-border {
    border-color: #ef4444 !important; /* Красная рамка */
}

.res-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 5px solid #e5e7eb;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    object-fit: cover;
}

.res-winner-avatar {
    border-color: #ffd700;
    box-shadow: 0 0 20px #ffd700;
}

/* Анимация появления карточки */
.pop-in {
    transform: scale(1) !important;
    opacity: 1 !important;
}

/* --- КАРТОЧКИ ИНВЕНТАРЯ --- */
.inv-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.3;
    background: #1f2937; /* Темный фон для всех карт */
    border: 2px solid #374151; /* Базовая рамка */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.inv-card:hover {
    transform: translateY(-5px) scale(1.02);
    z-index: 10;
}

.inv-card img {
    width: 60%;
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.6));
    z-index: 2;
}

.inv-card-cost {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 5;
}

/* Название карты */
.inv-card-name {
    font-size: 0.7rem;
    color: #e5e7eb;
    text-align: center;
    line-height: 1.1;
    padding: 0 4px;
    z-index: 2;
    font-weight: bold;
}

/* --- РЕДКОСТИ (Стили рамок и эффектов) --- */

/* COMMON (Обычная) */
.rarity-common { border-color: #6b7280; }
.rarity-common:hover { box-shadow: 0 0 10px #6b7280; }
.text-common { color: #9ca3af; }
.bg-common { background: #4b5563; }

/* UNCOMMON (Необычная) */
.rarity-uncommon { border-color: #22c55e; }
.rarity-uncommon:hover { box-shadow: 0 0 10px #22c55e; }
.text-uncommon { color: #4ade80; }
.bg-uncommon { background: #166534; }

/* RARE (Редкая) */
.rarity-rare { border-color: #3b82f6; }
.rarity-rare:hover { box-shadow: 0 0 15px #3b82f6; }
.text-rare { color: #60a5fa; }
.bg-rare { background: #1e40af; }

/* EPIC (Эпическая) */
.rarity-epic { border-color: #a855f7; }
.rarity-epic:hover { box-shadow: 0 0 15px #a855f7; }
.text-epic { color: #c084fc; }
.bg-epic { background: #7e22ce; }

/* LEGENDARY (Легендарная) - Золотая, дыхание, блик */
.rarity-legendary {
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    animation: legendary-breathe 3s infinite ease-in-out;
}

.text-legendary { color: #fcd34d; text-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
.bg-legendary { background: linear-gradient(135deg, #b45309, #f59e0b); }

/* Эффект блика (Shine) для легендарки */
.rarity-legendary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    transform: skewX(-25deg);
    animation: shine-sweep 4s infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes legendary-breathe {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3), inset 0 0 5px rgba(245, 158, 11, 0.1); border-color: #d97706; }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.8), inset 0 0 15px rgba(245, 158, 11, 0.3); border-color: #fbbf24; }
}

@keyframes shine-sweep {
    0% { left: -150%; }
    20% { left: 150%; } /* Блик пробегает быстро */
    100% { left: 150%; } /* Пауза */
}

/* EXOTIC (Экзотическая) - RGB Рамка, Космос */
.rarity-exotic {
    border: 2px solid transparent;
    background-image: linear-gradient(#1f2937, #1f2937), linear-gradient(45deg, #ec4899, #8b5cf6, #3b82f6, #ec4899);
    background-origin: border-box;
    background-clip: content-box, border-box;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
    animation: exotic-pulse 2s infinite linear;
}

/* Вращение цветов рамки для экзотики */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.text-exotic { color: #f472b6; text-shadow: 0 0 5px #ec4899; }
.bg-exotic { background: linear-gradient(90deg, #ec4899, #8b5cf6); }

@keyframes exotic-pulse {
    0% { box-shadow: 0 0 15px rgba(236, 72, 153, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.8); transform: scale(1.02); }
    100% { box-shadow: 0 0 15px rgba(236, 72, 153, 0.5); transform: scale(1); }
}

/* --- ТУЛТИП (Обновленный) --- */
#card-tooltip {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #4b5563;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
/* --- КАРТОЧКИ ИНВЕНТАРЯ --- */
.inv-card {
    position: relative;
    width: 100%;
    /* Фиксируем пропорции, чтобы они были одинаковыми */
    aspect-ratio: 1 / 1.45;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    border: 2px solid #374151;
    /* Гарантируем, что карта не будет сжиматься меньше 100px */
    min-width: 0;
}

/* Эффект наведения чуть скромнее, чтобы не обрезалось */
.inv-card:hover {
    transform: translateY(-5px) scale(1.03);
    z-index: 20;
}

.inv-card img {
    width: 80px;
    height: 80px;
    object-fit: contain; /* ничего не обрезает */
    margin-bottom: 8px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.7));
    z-index: 2;
    transition: transform 0.3s;
    image-rendering: crisp-edges;               /* Стандарт, сохраняет края */
    image-rendering: pixelated;
}

.inv-card:hover img {
    transform: scale(1.1); /* Картинка тоже чуть растет */
}

.inv-card-cost {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.inv-card-name {
    font-size: 0.7rem;
    color: #fff;
    text-align: center;
    line-height: 1.1;
    padding: 0 4px;
    z-index: 2;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* --- РЕДКОСТИ (Фоны и Рамки) --- */
/* Используем радиальные градиенты: Светлое пятно в центре, темнота по краям */

.rarity-common {
    border-color: #9ca3af;
    /* Светло-серая сталь в центре -> Темный металл по краям */
    background: radial-gradient(circle at center, #4b5563 0%, #1f2937 120%);
}
.rarity-common:hover { box-shadow: 0 0 15px rgba(156, 163, 175, 0.5); border-color: #e5e7eb; }

/* UNCOMMON (Необычная) - Ядовито-зеленый/Лесной */
.rarity-uncommon {
    border-color: #22c55e;
    /* Яркий изумруд в центре -> Темный лес по краям */
    background: radial-gradient(circle at center, #15803d 0%, #022c22 120%);
}
.rarity-uncommon:hover { box-shadow: 0 0 20px rgba(34, 197, 94, 0.6); border-color: #4ade80; }

/* RARE (Редкая) - Насыщенный синий */
.rarity-rare {
    border-color: #3b82f6;
    /* Лазурь в центре -> Глубина океана по краям */
    background: radial-gradient(circle at center, #1d4ed8 0%, #172554 120%);
}
.rarity-rare:hover { box-shadow: 0 0 25px rgba(59, 130, 246, 0.7); border-color: #60a5fa; }

/* EPIC (Эпическая) - Магический фиолетовый */
.rarity-epic {
    border-color: #a855f7;
    /* Яркий аметист в центре -> Темная магия по краям */
    background: radial-gradient(circle at center, #7e22ce 0%, #3b0764 120%);
}
.rarity-epic:hover { box-shadow: 0 0 25px rgba(168, 85, 247, 0.7); border-color: #d8b4fe; }

/* LEGENDARY (Легендарная) - Темное золото/Бронза */
.rarity-legendary {
    border-color: #b45309;
    /* Теплый, богатый коричневый фон */
    background: radial-gradient(circle at center, #78350f 0%, #270f03 100%);
    animation: legendary-pulse 3s infinite ease-in-out;
}
.rarity-legendary:hover {
    border-color: #f59e0b;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
}

/* Блик для легендарки */
.rarity-legendary::after {
    content: '';
    position: absolute;
    top: 0; left: -200%;
    width: 200%; height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 215, 0, 0.2) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: shine-sweep 4s infinite;
    pointer-events: none;
}

/* EXOTIC (Экзотическая) - Космический/Винный */
.rarity-exotic {
    border: 2px solid transparent; /* Прозрачный, чтобы видеть градиент рамки */
    background: radial-gradient(circle at center, #831843 0%, #2e021d 100%);
    /* RGB рамка */
    box-shadow: 0 0 0 2px #ec4899;
    animation: exotic-glow 2s infinite alternate;
}
.rarity-exotic:hover {
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.8), 0 0 10px rgba(255,255,255,0.5);
}

/* Анимации */
@keyframes legendary-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(180, 83, 9, 0.5); border-color: #b45309; }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.8); border-color: #fbbf24; }
}

@keyframes shine-sweep {
    0% { left: -200%; }
    40% { left: 200%; }
    100% { left: 200%; }
}

@keyframes exotic-glow {
    0% { box-shadow: 0 0 5px #ec4899; border-color: #ec4899; }
    100% { box-shadow: 0 0 20px #8b5cf6; border-color: #8b5cf6; }
}

/* Отступ для скроллбара, чтобы он не перекрывал карты */
#inventory-grid {
    scrollbar-gutter: stable;
}

/* Красивый скроллбар для инвентаря */
#inventory-grid::-webkit-scrollbar {
    width: 8px;
}
#inventory-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    margin: 10px 0; /* Отступ скроллбара сверху/снизу */
}
#inventory-grid::-webkit-scrollbar-thumb {
    background: #4b5568;
    border-radius: 4px;
}
#inventory-grid::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Статусы бустеров */
.booster-type-buff { color: #4ade80; border-color: #22c55e; }
.booster-bg-buff { background-color: #14532d; }

.booster-type-debuff { color: #f87171; border-color: #ef4444; }
.booster-bg-debuff { background-color: #450a0a; }

.booster-type-neutral { color: #94a3b8; border-color: #64748b; }
.booster-bg-neutral { background-color: #1e293b; }

/* Иконки под ником */
.boosters-container {
    display: flex;
    justify-content: center; /* Центрируем иконки */
    flex-wrap: wrap;         /* ВАЖНО: Разрешаем перенос на следующую строку */
    gap: 4px;                /* Отступ между иконками */
    margin-top: 6px;
    width: 100%;             /* Растягиваем на всю ширину карточки */
    padding: 0 10px;         /* Отступы по бокам, чтобы не прилипало к краям */

    /* Убираем фиксированную height: 34px */
    min-height: 34px;        /* Но оставляем минимальную высоту, чтобы не схлопывалось */
}

.booster-icon {
    position: relative; /* Важно для позиционирования цифры */
    width: 32px;        /* Было 20px -> Стало 32px */
    height: 32px;
    border-radius: 6px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    cursor: help;
    transition: transform 0.2s;
}

.booster-icon:hover {
    transform: scale(1.15);
    z-index: 10;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.booster-duration {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background-color: #ffffff; /* Темный фон */
    color: #000000;            /* Желтый текст */
    font-size: 10px;
    font-weight: 900;
    font-family: monospace;
    padding: 0.1px 3px;
    border-radius: 4px;
    border: 1px solid #4b5563;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
    pointer-events: none; /* Чтобы не мешало наводить мышь */
}

.booster-stack {
    position: absolute;
    top: -8px;
    right: 22px;
    background: linear-gradient(135deg, #fbbf24, #d97706); /* Золотой градиент */
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 0 2px;
    border-radius: 4px;
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6);
    z-index: 5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    animation: pop-stack 0.3s ease-out;
}

@keyframes pop-stack {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* === ЭФФЕКТ ЗАМОРОЗКИ (ПЛАВНЫЙ) === */
#freeze-overlay {
    /* СТАТИЧНЫЙ ФОН (Градиент не анимируем, чтобы не лагало) */
    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;
    pointer-events: none;
    z-index: 200;

    /* Анимации */
    animation:
        freeze-shiver 0.1s infinite, /* Дрожь */
        ice-pulse 3s ease-in-out infinite alternate; /* Плавное дыхание */
}

/* Снег и трещины оставляем как были */
#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;
}

#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% {
        /* Состояние "Сдавило": Тень жирная и насыщенная */
        /* Мы НЕ трогаем background, только тень! */
        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-fx {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at center, rgba(255,100,0,0.3) 0%, transparent 70%);
    overflow: hidden;
    opacity: 0;
    animation: resurrectFade 4s ease-in-out forwards;
}

/* Фейд ин/аут всего эффекта */
@keyframes resurrectFade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Множественные частицы огня/искр (восходящие) */
.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);
    }
}

/* Пламя снизу (настоящее пламя) */
.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; }
}

/* Центральное большое сердце с мощной анимацией */
.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;
    /* Включаем 3D-пространство для дочерних элементов */
    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);
    }
}

/* Вспышка света в центре */
.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 heart3DRotation {
    0% {
        transform: rotateY(0deg);
    }
    10% {
        transform: rotateY(360deg);         /* 1 оборот */
    }
    25% {
        transform: rotateY(720deg);         /* 2 оборота */
    }
    40% {
        transform: rotateY(1440deg);        /* 4 оборота */
    }
    55% {
        transform: rotateY(1800deg);        /* 5 полных оборотов */
    }
    100% {
        transform: rotateY(1800deg);        /* Держим финальное положение */
    }
}

@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; }
}

/* Дополнительные искры вокруг сердца (звёздочки) */
.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); }
}

/* Кнопка шпиона */
.spy-eye-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #a855f7;
    border-radius: 50%;
    color: #d8b4fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: help;
    z-index: 20;
    transition: all 0.2s;
    animation: pulseEye 2s infinite;
}

.spy-eye-btn:hover {
    background: #a855f7;
    color: white;
    transform: scale(1.2);
}

@keyframes pulseEye {
    0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(168, 85, 247, 0); }
    100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

/* === РУЛЕТКА === */
.roulette-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 3rem; color: #fff; margin-bottom: 30px;
    text-shadow: 0 0 10px #fff;
}

.roulette-window {
    width: 100%; max-width: 600px;
    height: 120px;
    background: linear-gradient(to bottom, #111, #222, #111);
    border-top: 4px solid #facc15;
    border-bottom: 4px solid #facc15;
    position: relative;
    overflow: hidden; /* Скрываем то, что вне зоны */
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.roulette-strip {
    display: flex;
    flex-direction: column; /* Вертикальная рулетка */
    align-items: center;
    position: absolute;
    width: 100%;
    top: 0;
    /* transition управляется JS */
}

.roulette-item {
    height: 120px; /* Высота равна высоте окна */
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    font-size: 2.5rem;
    font-weight: 900;
    color: #4b5563; /* Серый для пролетающих */
    text-transform: uppercase;
}

.roulette-item.highlight {
    color: #facc15;
    text-shadow: 0 0 20px #facc15;
    font-size: 3rem;
}

/* Указатели */
.roulette-pointer-left, .roulette-pointer-right {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 3rem; color: #ef4444; text-shadow: 0 0 10px black;
    z-index: 10;
}
.roulette-pointer-left { left: 20px; }
.roulette-pointer-right { right: 20px; }

.roulette-card {
    width: 200px;
    height: 160px;
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 2px solid #374151;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 10px; /* Отступ между картами */
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Иконка игры */
.roulette-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

/* Текст игры */
.roulette-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: #9ca3af;
    text-transform: uppercase;
    text-align: center;
    padding: 0 5px;
}

/* ЦЕЛЕВАЯ (ПОБЕДНАЯ) КАРТОЧКА */
.roulette-card.winner {
    background: linear-gradient(145deg, #3730a3, #312e81); /* Фиолетовый фон */
    border-color: #facc15; /* Золотая рамка */
}
.roulette-card.winner .roulette-name {
    color: #facc15;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

/* Класс для размытия в движении (добавляется JS-ом) */
.blur-motion {
    filter: blur(4px);
    transition: filter 0.2s;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}


/* Финальный взрыв монетки */
.coin-explode {
    animation: coin-explode-anim 0.6s ease-in forwards;
}
@keyframes coin-explode-anim {
    0% { transform: scale(1); opacity: 1; filter: blur(0); }
    100% { transform: scale(10); opacity: 0; filter: blur(20px); }
}

.coin-glow-legendary {
    background:
        radial-gradient(circle at center, rgba(251, 191, 36, 0.8) 0%, rgba(180, 83, 9, 0.4) 40%, transparent 75%),
        repeating-conic-gradient(from 0deg, transparent 0deg 20deg, rgba(255, 255, 255, 0.1) 25deg 30deg);
    animation: legendary-spin 10s linear infinite;
}

/* Экзотический: Космический RGB и пульсация */
.coin-glow-exotic {
    background: radial-gradient(circle at center, rgba(236, 72, 153, 0.6) 0%, rgba(139, 92, 246, 0.4) 40%, rgba(30, 58, 138, 0.3) 70%, transparent 90%);
    animation: exotic-chaos 4s ease-in-out infinite alternate;
}

/* Обычные редкости (простой градиент) */
.coin-glow-common { background: radial-gradient(circle, rgba(107, 114, 128, 0.6) 0%, transparent 70%); }
.coin-glow-uncommon { background: radial-gradient(circle, rgba(34, 197, 94, 0.6) 0%, transparent 70%); }
.coin-glow-rare { background: radial-gradient(circle, rgba(59, 130, 246, 0.6) 0%, transparent 70%); }
.coin-glow-epic { background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, transparent 70%); }

/* АНИМАЦИИ ДЛЯ ФОНОВ */
@keyframes legendary-spin {
    from { transform: rotate(0deg) scale(2.5); }
    to { transform: rotate(360deg) scale(2.5); }
}

@keyframes exotic-chaos {
    0% { filter: hue-rotate(0deg) saturate(1); transform: scale(1.2); }
    50% { filter: hue-rotate(180deg) saturate(2); transform: scale(1.5); }
    100% { filter: hue-rotate(360deg) saturate(1.5); transform: scale(1.3); }
}

#reward-card-container .inv-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Максимум 2 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    text-align: center;
    margin-top: auto; /* Прижимает текст к низу карты */
    margin-bottom: 10px;
}

#reward-card-container .inv-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.rarity-text-anim {
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.5s ease;
    display: inline-block;
}

/* Легендарный: Жидкое золото и блеск */
.coin-text-legendary {
    background-image: linear-gradient(90deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fcf6ba 75%, #bf953f 100%);
    animation: text-shine 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

/* Экзотический: Неоновый RGB перелив */
.coin-text-exotic {
    background-image: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6, #ec4899);
    animation: text-shine 2s linear infinite;
    filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.6));
}

/* Эпический: Пурпурное свечение */
.coin-text-epic {
    background-image: linear-gradient(90deg, #a855f7, #d8b4fe, #a855f7);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
}

/* Остальные просто цветные (без градиента для контраста) */
.coin-text-common { -webkit-text-fill-color: #6b7280; }
.coin-text-uncommon { -webkit-text-fill-color: #22c55e; }
.coin-text-rare { -webkit-text-fill-color: #3b82f6; }

/* Анимация движения градиента */
@keyframes text-shine {
    to { background-position: 200% center; }
}


#gamepad-cursor {
    width: 22px;
    height: 22px;

    /* 1. Основной цвет - полупрозрачный белый */
    background-color: rgba(255, 255, 255, 0.3);

    /* 2. Двойная обводка для контраста:
       border - белая внутренняя
       outline - черная внешняя (именно она спасает на белом фоне) */
    border: 2px solid #ffffff;
    outline: 2px solid rgba(0, 0, 0, 0.6);

    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999999;

    /* 3. Тень теперь темная и густая, чтобы "поднимать" курсор над белым фоном */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);

    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, border-color 0.2s ease;
    display: none;
}

/* Эффект при нажатии */
#gamepad-cursor.active {
    transform: translate(-50%, -50%) scale(0.7);
    background-color: rgba(255, 255, 255, 0.6);
    border-color: #facc15; /* Желтый акцент при клике */
    outline-color: #000;
}

/* --- Анимация использования карты над профилем игрока --- */
.flying-card-anim {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100px !important;
    height: 145px !important;
    margin: 0 !important;
    opacity: 0; /* Изначально прозрачная (спасает от мигания при появлении) */

    /* z-index: 50 кладет анимацию ПОД затемнение инвентаря (z-[60]), но НАД игроками */
    z-index: 50 !important;
    pointer-events: none !important;
    transform-style: preserve-3d;
    transform-origin: center center;
    will-change: transform, opacity;
}

/* Фиксы мерцания картинок и текста при 3D-вращении */
.flying-card-anim img,
.flying-card-anim .inv-card-name {
    backface-visibility: hidden;
}