/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Тёмный градиентный фон */
body {
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Верхняя часть с профилем */
/* Найти и заменить этот блок */
.header {
    display: flex !important;
    justify-content: flex-end !important; /* Прижимаем всё вправо */
    align-items: center !important;
    padding: 10px 0px 10px 10px !important; /* Минимум справа (4px) */
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    gap: 4px !important; /* Расстояние между балансом и аватаркой */
}

/* Баланс - КОРОТКАЯ КНОПКА */
/* Основные переменные (убедись, что они совпадают с твоим проектом) */
:root {
    --color-accent-blue: #a9d9f8;
}

/* Стили кнопки баланса */
.balance-display {
    position: relative;
    /* 1. РЕГУЛИРОВКА ОТСТУПА: увеличь, чтобы отодвинуть от авы влево */
    margin-right: -50px !important; 
    
    /* 2. ВЕРТИКАЛЬНОЕ ВЫРАВНИВАНИЕ: подгонка под центр аватарки */
    margin-top: -32px !important; 
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    padding: 8px 14px;
    background: rgba(169, 217, 248, 0.15);
    color: var(--color-accent-blue);
    font-weight: 700;
    font-size: 14px;
    border-radius: 14px;
    border: 1px solid rgba(169, 217, 248, 0.4);
    box-shadow: 
        0 0 0 1px rgba(169, 217, 248, 0.3),
        0 0 20px rgba(169, 217, 248, 0.15);
        
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0 !important;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(169, 217, 248, 0.5);
    z-index: 1;
    cursor: default;
    transition: all 0.3s ease;
}

/* Слой со снегом внутри кнопки */
.balance-display::before {
    content: "";
    position: absolute;
    top: -100%; /* Начальная точка выше видимой области */
    left: 0;
    width: 100%;
    height: 200%; /* Удвоенная высота для бесшовной анимации */
    background-image: 
        radial-gradient(2px 2px at 15% 15%, #fff 100%, transparent),
        radial-gradient(1.5px 1.5px at 40% 35%, #fff 100%, transparent),
        radial-gradient(2px 2px at 70% 20%, #fff 100%, transparent),
        radial-gradient(1px 1px at 85% 45%, #fff 100%, transparent),
        radial-gradient(2px 2px at 25% 65%, #fff 100%, transparent),
        radial-gradient(1.5px 1.5px at 60% 80%, #fff 100%, transparent),
        radial-gradient(2px 2px at 90% 70%, #fff 100%, transparent),
        radial-gradient(1px 1px at 10% 90%, #fff 100%, transparent);
    background-size: 100% 50%; /* Размер паттерна */
    animation: snow-animation 6s linear infinite;
    opacity: 0.5;
    z-index: -1; /* Снег за текстом */
    pointer-events: none;
}

/* Анимация падения снега */
@keyframes snow-animation {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(50%);
    }
}

/* Эффекты при наведении */
.balance-display:hover {
    background: rgba(169, 217, 248, 0.25);
    box-shadow: 
        0 0 0 1px rgba(169, 217, 248, 0.5),
        0 0 30px rgba(169, 217, 248, 0.3);
    border-color: var(--color-accent-blue);
    transform: translateY(-1px);

    /* --- ДОБАВЛЕННЫЕ СТРОКИ --- */
    color: #ffffff; /* Текст становится чисто белым */
    text-shadow: 0 0 15px rgba(169, 217, 248, 0.8); /* Усиливаем неоновое свечение */
}

/* Усиление снега при наведении */
.balance-display:hover::before {
    opacity: 0.8;
}

/* Дополнительный блеск (опционально) */
.balance-display::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: skewX(-25deg);
    transition: 0.75s;
    z-index: 2;
}

.balance-display:hover::after {
    left: 150%;
}

/* Аватарка профиля */
.profile {
    display: flex;
    align-items: center;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* ИЗМЕНЕНО: уменьшили толщину рамки с 3px до 2px для чистоты */
    border: 2px solid rgba(255, 215, 0, 0.3); 
    object-fit: cover;
    background: linear-gradient(45deg, #667eea, #764ba2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
    border-color: gold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Основной контент */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 20px 90px; /* Увеличено снизу для навигации */
    text-align: center;
}

/* Заголовок */
.title {
    font-size: 3.5em;
    background: linear-gradient(45deg, 
        #0066ff,     /* Яркий синий */
        #00ccff,     /* Голубой */
        #0066ff);    /* Яркий синий */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0px;
    text-shadow: 0 0 30px rgba(0, 102, 255, 0.3);
}

.subtitle {
    font-size: 1.2em;
    color: #a0a0c0;
    margin-bottom: 50px;
    opacity: 0.9;
}

/* Инструкция */
.instruction {
    margin-top: 30px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #aaa;
    font-size: 14px;
    max-width: 500px;
    margin-left: 20px;
    text-align: center;
}

/* Блок "скоро" */
.coming-soon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 20px;
    padding: 25px;
    margin-top: 60px;
    font-size: 1.2em;
    color: #ccc;
    backdrop-filter: blur(10px);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ============= СТИЛИ ДЛЯ СТРАНИЦЫ КЕЙСА ============= */

.case-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px 90px;
}

.case-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.case-title {
    color: #FFD700;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* === Стили для главной страницы с кейсом === */
.case-section {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* 2 колонки */
    gap: 15px !important; /* Расстояние между ними */
    margin: 20px auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 400px !important; /* Ограничиваем ширину для 2 колонок */
}

.case-card-link {
    display: block !important;
    width: 100% !important; /* Занимает всю ширину колонки */
    max-width: 180px !important; /* Максимальная ширина, но не фиксированная */
    height: 220px !important;
    text-decoration: none !important;
    margin: 0 auto !important; /* Автоматические отступы по бокам - ЦЕНТРИРОВАНИЕ */
    justify-self: center !important; /* Центрируем внутри grid ячейки */
}

/* Дополнительно для grid контейнера */
.case-section {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    justify-items: center !important; /* Центрируем все элементы по горизонтали */
    align-items: start !important; /* Выравниваем по верхнему краю */
    gap: 15px !important;
    margin: 20px auto !important;
    padding: 0 10px !important; /* Отступы по бокам */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Сама карточка внутри ссылки */
.case-card {
    width: 100% !important;
    height: 100% !important;
    /* остальные стили оставляем как есть */
}

.case-card-link:hover {
    transform: translateY(-8px);
}

.case-card {
    width: 100%;
    height: 100%;
    background: linear-gradient(165deg, 
        #001f3f 0%,       /* Темный синий (верх) */
        #003366 25%,      /* Немного светлее */
        #0066cc 50%,      /* Ярче в центре для акцента */
        #003366 75%,      /* Темнее к низу */
        #001f3f 100%);    /* Темный синий (низ) */
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(100, 180, 255, 0.25); /* Синяя граница */
    box-shadow: 
        0 15px 35px rgba(0, 60, 150, 0.4),      /* Тень темнее */
        inset 0 0 80px rgba(255, 255, 255, 0.07); /* Свечение слабее */
    transition: all 0.3s ease;
}

.case-card-link:hover .case-card {
    border-color: rgba(150, 200, 255, 0.5);
    box-shadow: 
        0 20px 45px rgba(0, 80, 200, 0.5),
        inset 0 0 100px rgba(255, 255, 255, 0.12);
}

/* Изображение */
.case-image {
    width: 100%;
    height: 110px;                     /* Было 140px, стало 110px */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 10px;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.4s ease;
}

/* Эффект при наведении */
.case-card-link:hover .case-image img {
    transform: scale(1.08);
}

/* Информация о кейсе */
.case-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 10px 5px;
    text-align: center;
    background: transparent !important;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-height: 70px;
}


/* Градиентный оверлей для информации */
.case-info::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to top, 
        rgba(0, 40, 100, 0.9) 0%,
        rgba(0, 40, 100, 0.5) 50%,
        transparent 100%);
    z-index: -1;
    border-radius: 18px;
}

/* Название кейса - СНЕЖНОЕ ПЕРЕЛИВАНИЕ */
.case-name {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: -5px;
    line-height: 1.2;
    
    /* Серебряно-снежный */
    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        #f8f8ff 30%,
        #e6e6fa 50%,
        #f0f8ff 70%,
        #ffffff 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Сложное сияние */
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(230, 230, 250, 0.7),
        0 0 30px rgba(176, 224, 230, 0.5),
        0 1px 2px rgba(0, 0, 0, 0.5);
    
    /* Анимация "мерцания снежинок" */
    animation: snow-twinkle 2s infinite alternate;
    position: relative;
    letter-spacing: 0.2px;
}

/* Плавное движение снега */
@keyframes snow-drift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Дополнительный эффект снежинок */
.case-name::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0;
    animation: snowfall 3s infinite linear;
    pointer-events: none;
}

@keyframes snow-twinkle {
    0% {
        filter: brightness(1) contrast(1);
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 0.9),
            0 0 25px rgba(230, 230, 250, 0.7);
    }
    100% {
        filter: brightness(1.2) contrast(1.1);
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 1),
            0 0 40px rgba(176, 224, 230, 0.9),
            0 0 60px rgba(135, 206, 250, 0.6);
    }
}

@keyframes snowfall {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    10%, 90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Кнопка с ценой - Меньше */
.case-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #003366 0%, #004080 50%, #003366 100%);
    padding: 4px 10px;
    border-radius: 14px;
    border: 2px solid rgba(100, 180, 255, 0.4);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 8px rgba(0, 40, 100, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    margin-top: 0;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    bottom: -5px !important;
    margin-bottom: 5px !important;
}


/* Иконка в цене */
.price-icon {
    font-size: 14px;
}

.price-amount {
    font-size: 15px; /* чуть меньше */
    font-weight: 800;
    color: white;
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.7),
        0 0 12px rgba(0, 100, 255, 0.4);
}

/* Индикатор "нажми" */
.case-card::after {
    content: '▶';
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.6);
    font-size: 16px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 4;
}

.case-card-link:hover .case-card::after {
    opacity: 1;
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* ===================== АДАПТИВНОСТЬ (ОСТАВЛЕНО ТОЛЬКО ДЛЯ КАРТОЧЕК) ===================== */
@media (max-width: 768px) {
    .case-section {
        justify-content: center;
        padding-left: 0;
    }
    
    .case-card-link {
        width: 180px;
        height: 210px;
    }
    
    .case-image {
        height: 120px !important; /* Исправленный стиль */
    }
    
    .case-name {
        font-size: 14px;
    }
    
    .price-amount {
        font-size: 14px; /* Изменено для 768px */
    }
    
    .case-info {
        padding: 0 10px 8px !important; /* Исправленный стиль */
        min-height: 80px !important; /* Исправленный стиль */
    }
    
    .instruction {
        margin: 30px auto;
        max-width: 400px;
        margin-left: auto; /* Исправлено на auto */
        margin-right: auto;
    }

    .case-price {
        padding: 4px 8px;
        border-radius: 12px;
    }
    .price-icon {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .case-card-link {
        width: 160px;
        height: 190px;
    }
    
    .case-image {
        height: 100px !important; /* Скорректировано для 480px */
        padding: 8px;
    }
    
    .case-name {
        font-size: 12px;
    }
    
    .price-amount {
        font-size: 13px; /* Изменено для 480px */
    }
    
    .case-price {
        padding: 3px 6px;
        border-radius: 10px;
    }
}

/* Добавляем управление блоком аватарки */
.profile-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    
    /* ВОТ ЭТО ЧИСЛО ДВИГАЕТ АВАТАРКУ ВПРАВО */
    /* Отрицательное значение (напр. -20px) тянет её К КРАЮ экрана */
    /* Положительное (напр. 20px) толкает её ВЛЕВО к балансу */
    margin-right: 0px !important; 
    
    gap: 6px !important; /* Расстояние между авой и кнопкой FREE SPIN */
}

/* Фикс для самой картинки, чтобы не было лишних отступов */
.profile {
    margin: 0 !important;
    padding: 0 !important;
}

/* Стили только для страницы рулетки */
.wheel-page .balance-display {
    /* Убираем фиксированное позиционирование, которое мешает */
    position: absolute !important; 
    
    /* Регулируй эти числа, чтобы поставить баланс идеально */
    top: 20px !important;   /* Отступ сверху */
    right: 5px !important;  /* Отступ справа (увеличь, если он наезжает на крестик или край) */
    
    /* Сброс лишних отступов */
    margin: 0 !important; 
}

/* Если на рулетке нет аватарки, можно сделать баланс побольше */
.wheel-page .balance-display {
    font-size: 18px !important;
    padding: 10px 20px !important;
}

/* Улучшенная 3D монета Giftly Coin */
.gc-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    position: relative;
    vertical-align: middle;
    margin-bottom: 3px;
    
    /* Золотой градиент с эффектом металла */
    background: radial-gradient(circle at 30% 30%, #fff9c4 0%, #ffcc00 50%, #e6ac00 100%);
    border-radius: 50%;
    
    /* Объемные границы (внешняя и внутренняя чеканка) */
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),            /* Тень под монетой */
        inset 0 -2px 2px rgba(0, 0, 0, 0.2),    /* Внутренняя тень снизу */
        inset 0 2px 2px rgba(255, 255, 255, 0.5), /* Блик сверху */
        0 0 0 1px #d4af37;                      /* Тонкий золотой ободок */
    
    font-family: 'Arial Black', sans-serif;
    font-style: normal;
    overflow: hidden;
}

/* Буквы GC внутри */
.gc-coin::before {
    content: 'GC';
    font-size: 0.55em;
    font-weight: 900;
    color: #5c4300;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.3); /* Эффект гравировки */
    z-index: 2;
}

/* Анимированный блик на всю монету */
.gc-coin::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        to bottom right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0) 40%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0) 60%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(35deg);
    animation: luxuryShine 4s infinite ease-in-out;
}

/* Элегантная анимация блеска */
@keyframes luxuryShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(35deg); }
    30% { transform: translateX(100%) translateY(100%) rotate(35deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(35deg); }
}

/* Эффект легкого пульсирующего свечения вокруг */
.balance-display .gc-coin {
    animation: coinGlow 2s infinite alternate;
}

@keyframes coinGlow {
    from { filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.4)); }
    to { filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8)); }
}

/* Убираем только горизонтальный скролл */
html, body {
    overflow-x: hidden !important;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #141e32 0%, #192841 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Поверх всего */
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
}

/* Крутящееся кольцо */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(169, 217, 248, 0.1);
    border-top: 5px solid #A9D9F8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-title {
    color: #fff;
    font-size: 24px;
    letter-spacing: 5px;
    margin: 0;
    text-shadow: 0 0 15px rgba(169, 217, 248, 0.5);
}

.loader-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-top: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}