/* ========================================================================= */
/*                           ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ                           */
/* ========================================================================= */

.profile-page {
    padding: var(--space-5xl) 0 var(--space-6xl) 0;
    background: var(--bg-primary);
    min-height: 70vh;
}

.profile-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-2xl);
}

.profile-tabs {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-3xl);
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: var(--space-sm);
}

.profile-tab {
    padding: var(--space-md) var(--space-2xl);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    bottom: -2px;
}

.profile-tab:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.profile-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.profile-account-section {
    background: rgba(15, 15, 15, 0.95);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(12px);
    overflow: hidden;
    margin-bottom: var(--space-4xl);
    box-shadow: var(--shadow-xl);
}

.profile-account-header {
    display: flex;
    align-items: center;
    gap: var(--space-3xl);
    padding: var(--space-4xl);
    background: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid var(--border-primary);
}

.profile-avatar-wrapper {
    flex-shrink: 0;
}

.profile-avatar-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(156, 163, 175, 0.3);
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(156, 163, 175, 0.2);
    object-fit: cover;
}

.profile-header-info {
    flex: 1;
}

.profile-username {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-lg);
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.profile-balance-container {
    display: flex;
    align-items: center;
    gap: var(--space-2xl);
}

.profile-balance-display {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-md);
    background: rgba(10, 10, 10, 0.6);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.profile-balance-label {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.profile-balance-amount {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.profile-actions {
    flex-shrink: 0;
}

.profile-topup-btn {
    padding: var(--space-lg) var(--space-3xl);
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.profile-topup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, #9f7aea, #8b5cf6);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
    padding: var(--space-4xl);
}

.profile-info-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-xl);
    background: rgba(10, 10, 10, 0.6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-base);
}

.profile-info-card:hover {
    background: rgba(20, 20, 20, 0.8);
    border-color: var(--color-primary);
}

.profile-info-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info-value {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.profile-edit-icon {
    cursor: pointer;
    transition: transform var(--transition-base);
    font-size: var(--font-size-xl);
}

.profile-edit-icon:hover {
    transform: scale(1.2);
}

.profile-main-content {
    background: rgba(15, 15, 15, 0.95);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(12px);
    padding: var(--space-4xl);
    box-shadow: var(--shadow-xl);
}

.profile-content {
    display: block;
}

.profile-section-title {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--border-primary);
}

.profile-characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-3xl);
}

.profile-character-card {
    background: rgba(10, 10, 10, 0.8);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.profile-character-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.profile-character-avatar {
    height: 180px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 1), rgba(10, 10, 10, 1));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    border-bottom: 1px solid var(--border-primary);
}

.profile-character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all var(--transition-base);
}

/* ========================================================================= */
/*                       КЛАССЫ ПЕРСОНАЖЕЙ (CHAR_ICON 1-9)                  */
/* ========================================================================= */

/* Warrior - Воин (Класс 1) */
.char_icon-1 {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(153, 27, 27, 0.1));
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.char_icon-1 img {
    filter: drop-shadow(0 4px 12px rgba(220, 38, 38, 0.5));
}

.char_icon-1:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.25), rgba(153, 27, 27, 0.15));
    border-color: rgba(220, 38, 38, 0.5);
}

/* Blader - Блэйдер (Класс 2) */
.char_icon-2 {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.15), rgba(194, 65, 12, 0.1));
    border: 1px solid rgba(234, 88, 12, 0.3);
}

.char_icon-2 img {
    filter: drop-shadow(0 4px 12px rgba(234, 88, 12, 0.5));
}

.char_icon-2:hover {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.25), rgba(194, 65, 12, 0.15));
    border-color: rgba(234, 88, 12, 0.5);
}

/* Wizard - Маг (Класс 3) */
.char_icon-3 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.char_icon-3 img {
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.5));
}

.char_icon-3:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.5);
}

/* Force Archer - Форс Арчер (Класс 4) */
.char_icon-4 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.char_icon-4 img {
    filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.5));
}

.char_icon-4:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.15));
    border-color: rgba(16, 185, 129, 0.5);
}

/* Force Shielder - Форс Шилдер (Класс 5) */
.char_icon-5 {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(126, 34, 206, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.char_icon-5 img {
    filter: drop-shadow(0 4px 12px rgba(168, 85, 247, 0.5));
}

.char_icon-5:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(126, 34, 206, 0.15));
    border-color: rgba(168, 85, 247, 0.5);
}

/* Force Blader - Форс Блэйдер (Класс 6) */
.char_icon-6 {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(219, 39, 119, 0.1));
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.char_icon-6 img {
    filter: drop-shadow(0 4px 12px rgba(236, 72, 153, 0.5));
}

.char_icon-6:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(219, 39, 119, 0.15));
    border-color: rgba(236, 72, 153, 0.5);
}

/* Gladiator - Гладиатор (Класс 7) */
.char_icon-7 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.char_icon-7 img {
    filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.5));
}

.char_icon-7:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.15));
    border-color: rgba(245, 158, 11, 0.5);
}

/* Force Gunner - Форс Ганнер (Класс 8) */
.char_icon-8 {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(8, 145, 178, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.char_icon-8 img {
    filter: drop-shadow(0 4px 12px rgba(6, 182, 212, 0.5));
}

.char_icon-8:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(8, 145, 178, 0.15));
    border-color: rgba(6, 182, 212, 0.5);
}

/* Dark Mage - Темный Маг (Класс 9) */
.char_icon-9 {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(109, 40, 217, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.char_icon-9 img {
    filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.5));
}

.char_icon-9:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(109, 40, 217, 0.15));
    border-color: rgba(139, 92, 246, 0.5);
}

/* Общие эффекты для всех иконок персонажей */
.char_icon {
    position: relative;
    overflow: hidden;
}

.char_icon::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 var(--transition-slow);
}

.profile-character-card:hover .char_icon::before {
    left: 100%;
}

.profile-character-info {
    padding: var(--space-2xl);
    flex: 1;
    background: rgba(15, 15, 15, 0.6);
}

.profile-character-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
}

.profile-character-name {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
}

.profile-character-class {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    background: rgba(10, 10, 10, 0.8);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    white-space: nowrap;
}

.profile-character-level-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.profile-character-level {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin: 0;
}

.profile-character-nation {
    color: var(--color-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.profile-character-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-primary);
}

.profile-character-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.profile-character-stat:first-child {
    text-align: left;
}

.profile-character-stat:last-child {
    text-align: right;
    margin-left: auto;
}

.profile-character-stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-character-stat-value {
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
}

.profile-no-characters {
    text-align: center;
    padding: var(--space-6xl) var(--space-2xl);
    color: var(--text-secondary);
}

.profile-no-characters p {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-md);
}

.profile-no-characters small {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

@media (max-width: 1024px) {
    .profile-account-header {
        flex-wrap: wrap;
        gap: var(--space-2xl);
    }

    .profile-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .profile-tabs {
        gap: var(--space-xs);
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .profile-tab {
        padding: var(--space-sm) var(--space-lg);
        font-size: var(--font-size-sm);
        white-space: nowrap;
    }

    .profile-account-header {
        flex-direction: column;
        text-align: center;
        padding: var(--space-3xl);
    }

    .profile-avatar-image {
        width: 100px;
        height: 100px;
    }

    .profile-username {
        font-size: var(--font-size-2xl);
    }

    .profile-balance-container {
        flex-direction: column;
        width: 100%;
        gap: var(--space-lg);
    }

    .profile-balance-display {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-md);
        width: 100%;
        padding: var(--space-md) var(--space-xl);
    }

    .profile-balance-amount {
        font-size: var(--font-size-3xl);
    }

    .profile-topup-btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-xl);
        font-size: var(--font-size-base);
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        padding: var(--space-3xl);
    }

    .profile-main-content {
        padding: var(--space-3xl);
    }

    .profile-characters-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-page {
        padding: var(--space-3xl) 0 var(--space-4xl) 0;
    }

    .profile-container {
        padding: 0 var(--space-lg);
    }

    .profile-account-header {
        padding: var(--space-2xl);
    }

    .profile-info-grid {
        padding: var(--space-2xl);
    }

    .profile-main-content {
        padding: var(--space-2xl);
    }

    .profile-character-stats {
        flex-direction: row;
        justify-content: space-between;
    }

    .profile-character-stat:first-child,
    .profile-character-stat:last-child {
        text-align: center;
        margin-left: 0;
    }

    .profile-character-stat {
        flex: 1;
    }

    .profile-character-stat-value {
        font-size: var(--font-size-lg);
    }
}

/* ========================================================================= */
/*                         НАСТРОЙКИ ПРОФИЛЯ                                */
/* ========================================================================= */

.profile-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-3xl);
}

.profile-settings-card {
    background: rgba(10, 10, 10, 0.8);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    padding: var(--space-3xl);
    transition: all var(--transition-base);
}

.profile-settings-card:hover {
    border-color: rgba(156, 163, 175, 0.4);
    background: rgba(15, 15, 15, 0.9);
}

/* Avatar Upload */
.profile-avatar-upload-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.avatar-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xl);
    padding: var(--space-2xl) 0;
}

.avatar-preview-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(156, 163, 175, 0.3);
    background: var(--bg-secondary);
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(156, 163, 175, 0.2);
    transition: all var(--transition-base);
}

.avatar-preview-image:hover {
    border-color: rgba(156, 163, 175, 0.5);
    transform: scale(1.05);
}

.avatar-upload-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 300px;
}

.avatar-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-base);
}

.avatar-file-label:hover {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(156, 163, 175, 0.4);
    color: var(--text-primary);
}

.avatar-file-label svg {
    width: 18px;
    height: 18px;
}

.avatar-upload-btn {
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.2), rgba(107, 114, 128, 0.15));
    border: 1px solid rgba(156, 163, 175, 0.3);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.avatar-upload-btn:hover {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.3), rgba(107, 114, 128, 0.2));
    border-color: rgba(156, 163, 175, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.2);
}

.avatar-hint {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    text-align: center;
}

/* Password Change */
.profile-password-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.password-change-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.password-change-form .modal__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.password-change-form .modal__field label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.password-change-form .modal__field input {
    padding: var(--space-md) var(--space-lg);
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
}

.password-change-form .modal__field input:focus {
    outline: none;
    border-color: rgba(156, 163, 175, 0.5);
    background: rgba(25, 25, 25, 0.8);
}

.password-change-form .modal__field input::placeholder {
    color: var(--text-tertiary);
}

.password-change-form .modal__field small {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    margin-top: calc(var(--space-xs) * -1);
}

.password-change-btn {
    margin-top: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.2), rgba(107, 114, 128, 0.15));
    border: 1px solid rgba(156, 163, 175, 0.3);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.password-change-btn:hover {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.3), rgba(107, 114, 128, 0.2));
    border-color: rgba(156, 163, 175, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.2);
}

/* Message animations */
.modal__message {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .profile-settings-grid {
        grid-template-columns: 1fr;
    }

    .avatar-upload-form {
        max-width: 100%;
    }
}