/* ========== MOBILE PROFILE STYLES ========== */

/* Overlay for Profile and Settings */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* ⚡ 40% затемнения - слоты видны как у Mellstroy! */
    z-index: 9998;
    display: none;
}

.bottom-sheet-overlay.active {
    display: block;
}

/* Profile Bottom Sheet */
.profile-bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 60px; /* ⚡ НЕ ЗАКРЫВАЕМ ВЕСЬ ЭКРАН - виден фон сверху! */
    background: #1f1632;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    border-top-left-radius: 24px; /* ⚡ ЗАКРУГЛЕННЫЕ УГЛЫ СВЕРХУ! */
    border-top-right-radius: 24px;
    overscroll-behavior: contain; /* ⚡ БЛОКИРОВКА ПРОКРУТКИ ФОНА! */
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
}

.profile-bottom-sheet.active {
    transform: translateY(0);
}

.profile-bottom-sheet .bottom-sheet-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: #1f1632;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-bottom-sheet .bottom-sheet-title {
    font-size: 18px; /* ⚡ КОМПАКТНЕЕ - было 24px */
    font-weight: bold;
    color: #FFFFFF;
    margin: 0;
    flex: 1; /* ⚡ Занимает доступное пространство */
    text-align: center; /* ⚡ Центрируем текст */
    white-space: nowrap; /* ⚡ Не переносим */
    overflow: hidden; /* ⚡ Обрезаем если слишком длинный */
    text-overflow: ellipsis; /* ⚡ Добавляем ... */
}

.profile-bottom-sheet .bottom-sheet-close {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Info Section */
.profile-user-info {
    padding: 12px 16px;
    margin: 0 16px 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 52px; /* ⚡ Чуть меньше - было 56px */
    height: 52px; /* ⚡ Чуть меньше - было 56px */
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px; /* ⚡ Чуть меньше - было 24px */
    font-weight: bold;
    color: #FFFFFF;
    flex-shrink: 0;
    cursor: pointer; /* ⚡ КЛИКАБЕЛЬНА ДЛЯ ЗАГРУЗКИ ФОТО */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-avatar:hover::after {
    content: '📷';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.profile-details {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 18px;
    font-weight: bold;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.profile-id {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.profile-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.profile-copy:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-copy svg {
    width: 16px; /* ⚡ Меньше для header */
    height: 16px;
    stroke: currentColor;
}

/* Balance Section */
.profile-balance-section {
    padding: 12px 16px 14px 16px;
    margin: 0 16px 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.balance-label {
    font-size: 12px; /* ⚡ ЕЩЕ КОМПАКТНЕЕ - было 13px */
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px; /* ⚡ Меньше - было 6px */
}

.balance-amount {
    font-size: 24px; /* ⚡ ЕЩЕ КОМПАКТНЕЕ - было 26px */
    font-weight: bold;
    color: #FFFFFF;
    margin-bottom: 12px; /* ⚡ Меньше отступ - было 14px */
}

.balance-actions {
    display: flex;
    gap: 8px;
}

.balance-btn {
    padding: 11px 14px; /* ⚡ ЕЩЕ КОМПАКТНЕЕ - было 12px 16px */
    border: none;
    border-radius: 8px; /* ⚡ Меньше скругление - было 10px */
    font-size: 14px; /* ⚡ ЕЩЕ МЕНЬШЕ - было 15px */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* ⚡ ЕЩЕ КОМПАКТНЕЕ - было 6px */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.balance-btn.deposit {
    flex: 1.8;
    background: linear-gradient(180deg, #46ff8f 0%, #20dd73 100%);
    color: #04121d;
    box-shadow: 0 16px 26px rgba(30, 225, 121, 0.3);
}

.balance-btn.deposit:hover {
    box-shadow: 0 18px 30px rgba(30, 225, 121, 0.32);
    transform: translateY(-2px);
}

.balance-btn.withdraw {
    flex: 1;
    background: rgba(14, 10, 36, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.balance-btn.withdraw:hover {
    background: rgba(14, 10, 36, 0.55);
    transform: translateY(-2px);
}

.balance-btn svg {
    width: 20px;
    height: 20px;
}

/* Profile Menu */
.profile-menu {
    padding: 4px 12px 12px 12px;
    margin: 0 16px 12px 24px;
}

.profile-menu-item {
    position: relative;
    background: rgba(39, 36, 66, 0.9);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
    overflow: hidden;
    z-index: 0;
}

.profile-menu-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(70, 255, 143, 0.45);
    opacity: 0.3;
    pointer-events: none;
    animation: profile-menu-border 2.4s ease-in-out infinite;
}

.profile-menu-item:hover {
    transform: translateX(4px);
    box-shadow: 0 12px 24px rgba(9, 6, 32, 0.35);
}

.profile-menu-item:active {
    transform: scale(0.98);
    background: rgba(31, 22, 50, 0.8);
}

.profile-menu-icon {
    width: 36px; /* ⚡ Меньше - было 40px */
    height: 36px; /* ⚡ Меньше - было 40px */
    border-radius: 8px; /* ⚡ Меньше скругление */
    background: rgba(163, 85, 247, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.profile-menu-icon svg {
    width: 18px; /* ⚡ Меньше - было 20px */
    height: 18px; /* ⚡ Меньше - было 20px */
    stroke: #A855F7;
}

.profile-menu-icon-badge {
    position: absolute;
    top: -2px; /* ⚡ Сдвинули выше */
    right: -2px; /* ⚡ Сдвинули правее */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
    border: 2px solid #190127; /* ⚡ Граница для лучшей видимости */
}

.profile-menu-text {
    flex: 1;
    min-width: 0;
}

.profile-menu-title {
    font-size: 14px; /* ⚡ ЕЩЕ КОМПАКТНЕЕ - было 15px */
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 1px; /* ⚡ Меньше - было 2px */
    line-height: 1.2; /* ⚡ Добавили для компактности */
}

.profile-menu-subtitle {
    font-size: 11px; /* ⚡ ЕЩЕ КОМПАКТНЕЕ - было 12px */
    color: rgba(255, 255, 255, 0.5); /* ⚡ Чуть бледнее */
    line-height: 1.2; /* ⚡ Улучшили */
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .profile-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .profile-name {
        font-size: 16px;
    }

    .balance-amount {
        font-size: 28px;
    }

    .balance-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .profile-menu-item {
        padding: 14px;
    }

    .profile-menu-icon {
        width: 40px;
        height: 40px;
    }

    .profile-menu-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Copy animation */
@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.profile-copy.copied {
    animation: copyPulse 0.3s ease-in-out;
    background: #10B981 !important;
}

/* Scrollbar for profile bottom sheet */
.profile-bottom-sheet::-webkit-scrollbar {
    width: 6px;
}

.profile-bottom-sheet::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.profile-bottom-sheet::-webkit-scrollbar-thumb {
    background: rgba(163, 85, 247, 0.5);
    border-radius: 3px;
}

.profile-bottom-sheet::-webkit-scrollbar-thumb:hover {
    background: rgba(163, 85, 247, 0.7);
}

/* ========== DESKTOP VERSION - ЦЕНТРАЛЬНАЯ ПЛАШКА КАК У MELLSTROY ========== */
@media (min-width: 768px) {
    /* На десктопе профиль - это центральная модалка, а не bottom sheet */
    .profile-bottom-sheet {
        left: 50%;
        right: auto;
        top: 50%;
        bottom: auto;
        width: 90%;
        max-width: 450px; /* ⚡ УЖЕ КАК У MELLSTROY (БЫЛО 480px) */
        max-height: 85vh; /* ⚡ ВЫШЕ КАК У MELLSTROY (БЫЛО 80vh) */
        transform: translate(-50%, -50%) translateY(150vh); /* ⚡ СНИЗУ ЗА ЭКРАНОМ! */
        border-radius: 28px; /* ⚡ БОЛЕЕ ЗАКРУГЛЕННЫЕ УГЛЫ КАК У MELLSTROY (БЫЛО 20px) */
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Плавная анимация */
    }
    
    .profile-bottom-sheet.active {
        transform: translate(-50%, -50%); /* ⚡ ЦЕНТР ЭКРАНА */
    }
    
    /* Header более компактный */
    .profile-bottom-sheet .bottom-sheet-header {
        padding: 14px 20px; /* ⚡ МЕНЬШЕ PADDING */
        border-top-left-radius: 28px; /* ⚡ БОЛЕЕ ЗАКРУГЛЕННЫЕ КАК У MELLSTROY */
        border-top-right-radius: 28px; /* ⚡ БОЛЕЕ ЗАКРУГЛЕННЫЕ КАК У MELLSTROY */
    }
    
    .profile-bottom-sheet .bottom-sheet-title {
        font-size: 18px; /* ⚡ МЕНЬШЕ РАЗМЕР */
    }
}

/* ========== BET HISTORY STYLES ========== */

/* Loader */
.bet-history-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: #A855F7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Список ставок */
.bet-history-list {
    padding: 4px 12px 12px 12px; /* ⚡ КОМПАКТНЕЕ - было 8px 16px 16px */
}

.bet-history-item {
    background: rgba(31, 22, 50, 0.6);
    border-radius: 10px; /* ⚡ Меньше - было 12px */
    padding: 10px; /* ⚡ КОМПАКТНЕЕ - было 14px */
    margin-bottom: 6px; /* ⚡ Меньше - было 8px */
    display: flex;
    align-items: center;
    gap: 10px; /* ⚡ Компактнее - было 12px */
    transition: all 0.3s ease;
}

.bet-history-item:active {
    transform: scale(0.98);
    background: rgba(31, 22, 50, 0.8);
}

/* Иконка игры */
.bet-history-game-icon {
    width: 42px; /* ⚡ Меньше - было 48px */
    height: 42px; /* ⚡ Меньше - было 48px */
    border-radius: 10px; /* ⚡ Меньше - было 12px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px; /* ⚡ Меньше - было 18px */
    font-weight: bold;
    color: #FFFFFF;
    flex-shrink: 0;
}

/* ⚡ SVG иконки внутри - белый цвет */
.bet-history-game-icon svg {
    width: 22px; /* ⚡ Меньше - было 24px */
    height: 22px; /* ⚡ Меньше - было 24px */
    color: #FFFFFF;
    fill: currentColor;
}

.bet-history-game-icon.crash { background: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%); }
.bet-history-game-icon.dice { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); }
.bet-history-game-icon.mines { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.bet-history-game-icon.keno { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }
.bet-history-game-icon.coinflip { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.bet-history-game-icon.shoot { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); }

/* Информация о ставке */
.bet-history-info {
    flex: 1;
    min-width: 0;
}

.bet-history-game-name {
    font-size: 14px; /* ⚡ КОМПАКТНЕЕ - было 15px */
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 2px; /* ⚡ Меньше - было 4px */
    line-height: 1.2; /* ⚡ Компактность */
}

.bet-history-date {
    font-size: 11px; /* ⚡ КОМПАКТНЕЕ - было 12px */
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2; /* ⚡ Компактность */
}

/* Сумма ставки и выигрыша */
.bet-history-amounts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px; /* ⚡ Меньше - было 4px */
}

.bet-history-bet {
    font-size: 11px; /* ⚡ КОМПАКТНЕЕ - было 13px */
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2; /* ⚡ Компактность */
}

.bet-history-profit {
    font-size: 15px; /* ⚡ КОМПАКТНЕЕ - было 16px */
    font-weight: 700;
    line-height: 1.2; /* ⚡ Компактность */
}

.bet-history-profit.win {
    color: #10B981;
}

.bet-history-profit.lose {
    color: #EF4444;
}

/* Пустое состояние */
.bet-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.bet-history-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.bet-history-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.bet-history-empty-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

@keyframes profile-menu-border {
    0%, 100% {
        opacity: 0.25;
    }
    50% {
        opacity: 0.55;
    }
}

