/* ===== КОМПОНЕНТЫ ИНТЕРФЕЙСА ===== */

/* Стиль для иконки звезды, такой же размер как эмоджи ★ */
.star-icon {
    width: 1em; /* Будет равен размеру шрифта родителя */
    height: 1em;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
}

/* Для профиля вверху (там звезда побольше) */
.star-pill .star-icon {
    width: 20px;
    height: 20px;
}

/* Для цен в карточках кейсов */
.price .star-icon {
    width: 16px;
    height: 16px;
}

/* Для модального окна кейса */
.case-price .star-icon {
    width: 20px;
    height: 20px;
}

/* Профиль пользователя */
.profile-row {
    background: linear-gradient(135deg, rgba(26, 34, 41, 0.8), rgba(33, 42, 50, 0.6));
    margin: 15px;
    padding: 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.profile-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.1), transparent);
    transition: left 0.6s;
}

.profile-row:hover::before {
    left: 100%;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 0 30px var(--accent-glow);
}

.profile-info {
    flex: 1;
}

.username {
    font-weight: 800;
    font-size: 18px;
    background: var(--main-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 4px;
}

.user-level {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

/* Звезды */
.stars-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.star-pill {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    padding: 10px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 215, 105, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.star-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 105, 0.2);
}

.star-pill .star {
    /* font-weight: 900;
    color: #ffd769;
    text-shadow: 0 0 10px rgba(255, 215, 105, 0.5); */
}

/* Эмодзи панель */
.ribbon {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    overflow: auto;
    margin: 0 15px;
}

.emoji-pill {
    min-width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.emoji-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.emoji-pill:hover::before {
    left: 100%;
}

.emoji-pill:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Сортировка */
.sort {
    margin: 10px 15px;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 15px;
    padding: 14px 16px;
    color: var(--text);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort:hover {
    background: linear-gradient(135deg, #323d47, #1f2830);
    transform: translateY(-2px);
}

/* Сетка кейсов */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
}

.card {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 20px;
    padding: 15px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--main-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 200, 255, 0.3);
}

.card .topimg {
    height: 130px;
    border-radius: 12px;
    background: linear-gradient(135deg, #39464c, #2b373d);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card .topimg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover .topimg::after {
    opacity: 1;
}

.card img.case {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card:hover img.case {
    transform: scale(1.1);
}

.card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    color: var(--muted);
}

.price {
    font-weight: 900;
    color: #ffd769;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 215, 105, 0.3);
}

/* Бейджи */
.limit-pill {
    background: var(--premium-gradient);
    color: #1b1b1b;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 11px;
    margin-left: 6px;
    box-shadow: 0 2px 8px rgba(251, 197, 49, 0.3);
}

.new-pill {
    background: var(--main-gradient);
    color: white;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 11px;
    margin-left: 6px;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Добавьте эти стили после существующих бейджей */
.premium-pill {
    background: var(--premium-gradient);
    color: #1b1b1b;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 11px;
    margin-left: 6px;
    box-shadow: 0 2px 8px rgba(251, 197, 49, 0.3);
}

.exclusive-pill {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 11px;
    margin-left: 6px;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

/* ===== КНОПКИ ПОПОЛНЕНИЯ БАЛАНСА ===== */

/* Кнопка пополнения баланса (плюсик) */
.add-balance-btn {
    background: var(--main-gradient);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    margin-left: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.add-balance-btn:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.add-balance-btn:active {
    transform: scale(1.05) rotate(90deg);
}

.add-balance-icon {
    color: white;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    transition: all 0.3s ease;
}

/* Для мобильных */
@media (max-width: 420px) {
    .add-balance-btn {
        width: 26px;
        height: 26px;
    }
    
    .add-balance-icon {
        font-size: 18px;
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ПОПОЛНЕНИЯ БАЛАНСА ===== */

.balance-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

.balance-modal.active {
    display: flex;
}

.balance-modal-content {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 25px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.balance-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(26, 34, 41, 0.8), rgba(33, 42, 50, 0.6));
}

.balance-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.balance-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 300;
}

.balance-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    transform: rotate(90deg);
}

.balance-modal-body {
    padding: 25px;
}

/* Текущий баланс */
.balance-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-current-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
}

.balance-current-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: #ffd769;
}

.balance-current-value .star-icon {
    width: 22px;
    height: 22px;
}

/* Сетка сумм */
.amounts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 15px 0 25px;
}

.amount-option {
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.9), rgba(26, 34, 41, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 18px 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.amount-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 105, 0.1), transparent);
    transition: left 0.6s;
}

.amount-option:hover::before {
    left: 100%;
}

.amount-option:hover {
    border-color: #ffd769;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 215, 105, 0.2);
}

.amount-option.active {
    background: linear-gradient(135deg, #ffd769, #ffb347);
    color: #1a2229;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(255, 215, 105, 0.3);
}

.amount-option.active::after {
    content: '★';
    font-size: 14px;
}

/* Поле ввода суммы */
.balance-input {
    width: 100%;
    padding: 18px 20px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    margin-top: 10px;
}

.balance-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.balance-hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
    text-align: center;
    line-height: 1.4;
}

.balance-modal-footer {
    padding: 15px 25px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-submit-btn {
    background: var(--main-gradient);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 18px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--accent-glow);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.balance-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.balance-submit-btn:hover::before {
    left: 100%;
}

.balance-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--accent-glow);
}

.balance-submit-btn:active {
    transform: translateY(-1px);
}

/* Навигация */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: rgba(26, 34, 41, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    color: var(--muted);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    padding: 8px 12px;
    gap: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border-radius: 16px;
    min-width: 60px;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--main-gradient);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item img {
    width: 24px;
    height: 24px;
    opacity: .7;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    filter: brightness(0.8);
}

.nav-item:hover img {
    transform: scale(1.15);
    opacity: 1;
}

.nav-item.active {
    color: white;
    transform: translateY(-5px);
}

.nav-item.active img {
    opacity: 1;
    transform: scale(1.2);
    filter: brightness(1);
}

.nav-item div {
    position: relative;
    z-index: 1;
    font-weight: 600;
}

/* ===== СТРАНИЦА WIN GAMES ===== */
#page-games {
    background: linear-gradient(180deg, #0c0f16 0%, #1a2229 100%);
}

.games-header {
    padding: 30px 20px 20px;
    text-align: center;
    background: linear-gradient(135deg, #0c0f16, #151925);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.games-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #ffd769);
}

.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ff3838);
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.event-icon {
    font-size: 20px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

.event-text {
    font-size: 14px;
    font-weight: 800;
    color: white;
}

.games-list {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-banner {
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    min-height: 220px;
    border: 2px solid transparent;
}

.game-banner:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.jetcoin-game {
    background: linear-gradient(135deg, #1a1f2e, #0f1419);
    border-color: rgba(78, 205, 196, 0.3);
}

.present-roll {
    background: linear-gradient(135deg, #2d1a3d, #1a0f25);
    border-color: rgba(155, 89, 182, 0.3);
}

.game-banner-content {
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.game-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.new-year-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff3838);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

.game-hot-badge, .game-lucky-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.game-hot-badge {
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.game-lucky-badge {
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.game-banner-body {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.game-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
}

.jetcoin-game .game-title {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.present-roll .game-title {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.game-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

.game-banner-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.game-stat {
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
}

.game-play-btn {
    background: linear-gradient(135deg, #ffd769, #ffb347);
    color: #1a2229;
    border: none;
    padding: 12px 30px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 105, 0.3);
}

.game-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 215, 105, 0.4);
}

/* Информационные карточки игр */
.games-info {
    padding: 0 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-card {
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.8), rgba(26, 34, 41, 0.9));
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-icon {
    font-size: 24px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #00c8ff, #0099ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
    line-height: 1.4;
}

/* Адаптивность для игр */
@media (max-width: 420px) {
    .game-banner {
        min-height: 200px;
    }
    
    .game-banner-content {
        padding: 20px;
    }
    
    .game-icon {
        font-size: 50px;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .game-play-btn {
        padding: 10px 25px;
        font-size: 13px;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* ===== СТРАНИЦА ПРЕМИУМ ===== */
#page-upgrade {
    background: linear-gradient(180deg, #1a1f2e 0%, var(--bg) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* ← Вот ключевая строка! */
    min-height: 100vh; /* Занимает всю высоту экрана */
    padding: 20px;
    box-sizing: border-box;
}

.upgrade-content {
    text-align: center;
    max-width: 300px;
    width: 100%;
    margin: auto; /* Автоматические отступы по центру */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upgrade-icon {
    font-size: 80px;
    margin-bottom: 20px;
    background: var(--main-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.upgrade-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--main-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.upgrade-subtitle {
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.4;
}

.upgrade-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.upgrade-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-icon {
    font-size: 20px;
    color: var(--accent);
}

.feature-text {
    color: var(--text);
    font-weight: 600;
}

.upgrade-button {
    background: var(--main-gradient);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--accent-glow);
    width: 100%;
}

.upgrade-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--accent-glow);
}

/* ===== СТРАНИЦА РЕЙТИНГА ===== */
#page-rate {
    background: linear-gradient(180deg, #1a1f2e 0%, var(--bg) 100%);
}

.leaderboard-header {
    padding: 30px 20px 20px;
    text-align: center;
    background: linear-gradient(135deg, #1a1f2e, #151925);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.leaderboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--main-gradient);
}

.leaderboard-tabs {
    display: flex;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 15px;
    margin: 20px 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 13px;
    position: relative;
}

.leaderboard-tab.active {
    background: var(--main-gradient);
    color: white;
}

.leaderboard-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-list {
    padding: 0 15px 20px;
}

.leaderboard-item {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    border-color: rgba(0, 200, 255, 0.3);
}

.leaderboard-rank {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #39464c, #2b373d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, var(--gold), #ffa500);
    color: black;
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, var(--silver), #a0a0a0);
    color: black;
    border-color: rgba(192, 192, 192, 0.5);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, var(--bronze), #b5651d);
    color: white;
    border-color: rgba(205, 127, 50, 0.5);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

.leaderboard-avatar {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.leaderboard-item:hover .leaderboard-avatar {
    border-color: var(--accent);
    transform: scale(1.05);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 15px;
}

.leaderboard-level {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.leaderboard-stats {
    text-align: right;
}

.leaderboard-stars {
    color: #ffd769;
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(255, 215, 105, 0.3);
}

.leaderboard-wins {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.current-user-highlight {
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    background: linear-gradient(135deg, #2d3740, #25313a);
}

/* ===== СТРАНИЦА ПРОФИЛЯ ===== */
#page-profile {
    background: linear-gradient(180deg, #1a2229 0%, var(--bg) 100%);
}

/* ===== ОБНОВЛЕННЫЙ ПРОФИЛЬ ===== */
.profile-header {
    padding: 30px 20px 25px;
    text-align: center;
    background: linear-gradient(135deg, #1a2229, #151b22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.profile-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(0, 200, 255, 0.1), transparent 70%);
    z-index: 0;
}

.profile-header-content {
    position: relative;
    z-index: 1;
}

.profile-avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 25px;
    object-fit: cover;
    border: 4px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    position: relative;
    z-index: 1;
}

.profile-avatar-frame {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid transparent;
    border-radius: 30px;
    background: linear-gradient(135deg, #00c8ff, #0099ff) border-box;
    -webkit-mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 0;
}

.profile-status {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--success-gradient);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    z-index: 2;
    border: 2px solid var(--bg);
}

.profile-info-main {
    margin-bottom: 15px;
}

.profile-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, #a0e7ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.3);
}

.profile-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.level-icon {
    font-size: 16px;
    color: #ffd769;
}

.level-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.profile-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.profile-tag {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.elite-tag {
    background: linear-gradient(135deg, #ffd769, #ffb347);
    color: #1a2229;
}

.premium-tag {
    background: var(--main-gradient);
    color: white;
}

/* Секции профиля */
.profile-section {
    padding: 0 20px 25px;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 5px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 25px 20px;
}

.profile-stat-card {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--main-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.profile-stat-card:hover::before {
    transform: scaleX(1);
}

.profile-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.profile-stat-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative; /* Для позиционирования кнопки */
}

.profile-stat-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
}

.profile-achievements {
    padding: 25px 20px;
}

.achievements-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text);
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.achievement-item {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.achievement-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--main-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.achievement-item:hover::before {
    transform: scaleX(1);
}

.achievement-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.achievement-icon {
    font-size: 36px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.achievement-item:hover .achievement-icon {
    transform: scale(1.2) rotate(5deg);
}

.achievement-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.achievement-desc {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
}

.achievement-locked {
    opacity: 0.6;
    filter: grayscale(0.8);
}

.achievement-locked:hover {
    opacity: 0.8;
    filter: grayscale(0.5);
}

/* ===== КНОПКА И МОДАЛЬНОЕ ОКНО ПРОМОКОДА ===== */

/* Контейнер для кнопки промокода */
.profile-actions {
    padding: 0 20px 20px; /* Уменьшили нижний отступ */
}

.promo-button-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* Для мобильных */
@media (max-width: 420px) {
    .profile-actions {
        padding: 0 15px 15px;
    }
}

/* Кнопка активации промокода */
.promo-button {
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.9), rgba(26, 34, 41, 0.9));
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 18px;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    max-width: 320px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.promo-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.1), transparent);
    transition: left 0.6s;
}

.promo-button:hover::before {
    left: 100%;
}

.promo-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 200, 255, 0.2);
    border-color: var(--accent);
}

.promo-button-icon {
    font-size: 28px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #00c8ff, #0099ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.promo-button-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    flex: 1;
}

/* Модальное окно промокода */
.promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.promo-modal.active {
    display: flex;
}

.promo-modal-content {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 25px;
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideUp {
    from { 
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.promo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(26, 34, 41, 0.8), rgba(33, 42, 50, 0.6));
}

.promo-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.promo-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 300;
}

.promo-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    transform: rotate(90deg);
}

.promo-modal-body {
    padding: 25px;
}

.promo-input {
    width: 100%;
    padding: 18px 20px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.promo-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.promo-hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
    text-align: center;
    line-height: 1.4;
}

.promo-modal-footer {
    padding: 15px 25px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-submit-btn {
    background: var(--main-gradient);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 18px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--accent-glow);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.promo-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.promo-submit-btn:hover::before {
    left: 100%;
}

.promo-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--accent-glow);
}

.promo-submit-btn:active {
    transform: translateY(-1px);
}

/* Адаптивность для мобильных */
@media (max-width: 420px) {
    .profile-actions {
        padding: 0 15px 25px;
    }
    
    .promo-button {
        padding: 15px 20px;
        gap: 12px;
    }
    
    .promo-button-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .promo-button-text {
        font-size: 15px;
    }
    
    .promo-modal-content {
        max-width: 340px;
    }
    
    .promo-modal-header {
        padding: 20px 20px 15px;
    }
    
    .promo-modal-body {
        padding: 20px;
    }
    
    .promo-input {
        padding: 16px 18px;
        font-size: 15px;
    }
    
    .promo-modal-footer {
        padding: 15px 20px 20px;
    }
    
    .promo-submit-btn {
        padding: 16px;
        font-size: 15px;
    }
}

/* ===== СТРАНИЦА ИСТОРИИ ===== */
#page-history {
    background: linear-gradient(180deg, #1a2229 0%, var(--bg) 100%);
}

.history-header {
    padding: 30px 20px 20px;
    text-align: center;
    background: linear-gradient(135deg, #1a2229, #151b22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.history-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--main-gradient);
}

.history-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--main-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 6px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.history-list {
    padding: 0 20px 20px;
}

.history-item {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--main-gradient);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-item:hover::before {
    opacity: 1;
}

.history-item:hover {
    transform: translateX(8px);
    border-color: rgba(0, 200, 255, 0.3);
}

.history-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #39464c, #2b373d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.history-item:hover .history-icon {
    border-color: var(--accent);
    transform: scale(1.1);
}

.history-info {
    flex: 1;
}

.history-case {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 15px;
}

.history-prize {
    color: var(--muted);
    font-size: 13px;
}

.history-stars {
    color: #ffd769;
    font-weight: 800;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 215, 105, 0.3);
}

.history-date {
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

.empty-history {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}

.empty-history-icon {
    font-size: 70px;
    margin-bottom: 20px;
    opacity: 0.5;
}


.profile-stat-value,
.stat-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-stat-value .star-icon,
.stat-value .star-icon {
    width: 24px;
    height: 24px;
}

@media (max-width: 420px) {
    .balance-modal-content {
        max-width: 350px;
    }
    
    .balance-modal-header {
        padding: 20px 20px 15px;
    }
    
    .balance-modal-body {
        padding: 20px;
    }
    
    .balance-current {
        padding: 12px;
    }
    
    .balance-current-value {
        font-size: 18px;
    }
    
    .amounts-grid {
        gap: 10px;
    }
    
    .amount-option {
        padding: 15px 8px;
        font-size: 16px;
    }
    
    .balance-input {
        padding: 16px 18px;
        font-size: 15px;
    }
    
    .balance-modal-footer {
        padding: 15px 20px 20px;
    }
    
    .balance-submit-btn {
        padding: 16px;
        font-size: 15px;
    }
    
    .profile-stat-value .star-icon,
    .stat-value .star-icon {
        width: 20px;
        height: 20px;
    }

    .app {
        padding-bottom: 90px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .bottom-nav {
        height: 85px;
    }
    
    .nav-item {
        min-width: 55px;
        padding: 6px 10px;
    }
    
    .prizes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reveal-text {
        font-size: 28px;
    }
    
    .reveal-name {
        font-size: 20px;
    }
    
    .prize-scroll-item {
        width: 100px;
        height: 140px;
        margin: 0 6px;
    }
    
    .center-indicator {
        width: 120px;
        height: 160px;
    }
    
    .scroll-prize-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .scroll-prize-name {
        font-size: 11px;
    }
    
    .scroll-prize-chance {
        font-size: 9px;
    }

}

/* ===== МОДАЛЬНОЕ ОКНО ИСТОРИИ ОПЕРАЦИЙ ===== */

.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 4001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

.history-modal.active {
    display: flex;
}

.history-modal-content {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 25px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(26, 34, 41, 0.8), rgba(33, 42, 50, 0.6));
    flex-shrink: 0;
}

.history-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.history-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 300;
}

.history-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    transform: rotate(90deg);
}

.history-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Статистика истории */
.history-stats-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.history-stat {
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.9), rgba(26, 34, 41, 0.9));
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.history-stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* Табы истории */
.history-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.8), rgba(26, 34, 41, 0.9));
    border-radius: 15px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-tab {
    padding: 10px 5px;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--muted);
}

.history-tab.active {
    background: var(--main-gradient);
    color: white;
}

.history-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

/* Список операций */
.history-operations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.operation-item {
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.9), rgba(26, 34, 41, 0.9));
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.operation-item:hover {
    border-color: rgba(0, 200, 255, 0.3);
    transform: translateX(5px);
}

.operation-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.case-icon {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.2), rgba(0, 200, 255, 0.1));
    color: var(--accent);
}

.promo-icon {
    background: linear-gradient(135deg, rgba(255, 215, 105, 0.2), rgba(255, 215, 105, 0.1));
    color: #ffd769;
}

.payment-icon {
    background: linear-gradient(135deg, rgba(44, 189, 50, 0.2), rgba(44, 189, 50, 0.1));
    color: #44bd32;
}

.operation-info {
    flex: 1;
    min-width: 0;
}

.operation-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 14px;
}

.operation-details {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operation-time {
    font-size: 11px;
    color: var(--muted);
    opacity: 0.8;
}

.operation-amount {
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.operation-amount.positive {
    color: #44bd32;
}

.operation-amount.negative {
    color: #ff4757;
}

/* Кнопки в профиле */
.profile-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.profile-action-btn {
    background: linear-gradient(135deg, rgba(45, 55, 64, 0.9), rgba(26, 34, 41, 0.9));
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 18px;
    padding: 18px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.profile-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.1), transparent);
    transition: left 0.6s;
}

.profile-action-btn:hover::before {
    left: 100%;
}

.profile-action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 200, 255, 0.2);
    border-color: var(--accent);
}

.action-btn-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00c8ff, #0099ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    flex: 1;
}

/* Пустая история */
.empty-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-history-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Адаптивность */
@media (max-width: 420px) {
    .history-modal-content {
        max-width: 380px;
        max-height: 85vh;
    }
    
    .history-modal-header {
        padding: 20px 20px 15px;
    }
    
    .history-modal-body {
        padding: 15px;
    }
    
    .history-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .history-tab {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .profile-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-action-btn {
        padding: 15px 12px;
    }
    
    .action-btn-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .action-btn-text {
        font-size: 14px;
    }
}

/* ===== ТЕЛЕГРАМ ФИКСЫ ===== */
@media (hover: none) and (pointer: coarse) {
    /* Оптимизация для сенсорных устройств (Telegram) */
    .profile-action-btn,
    #history-button {
        -webkit-tap-highlight-color: rgba(0, 200, 255, 0.3);
        min-height: 44px; /* Минимальный размер для touch */
        min-width: 44px;
    }
    
    /* Улучшение отзывчивости модальных окон в Telegram */
    .history-modal.active,
    .balance-modal.active,
    .promo-modal.active {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Фикс для z-index в Telegram Web App */
.tg-web-app {
    position: relative;
    z-index: 1;
}

.history-modal.active {
    z-index: 9999 !important;
}