/* User Profile Popup Styles */

/* Кнопка профиля */
.user-profile-button {
    position: fixed;
    top: 20px; /* ВМЕСТО кнопки настроек */
    right: 20px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-profile-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.user-profile-button:active {
    transform: scale(0.95);
}

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

.user-profile-button .default-avatar {
    font-size: 24px;
    color: white;
    font-weight: bold;
}

/* Попап профиля */
.user-profile-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.user-profile-popup.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.user-profile-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

/* Кастомный скроллбар */
.user-profile-content::-webkit-scrollbar {
    width: 8px;
}

.user-profile-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.user-profile-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.user-profile-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.user-profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.user-profile-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.user-profile-header {
    text-align: center;
    margin-bottom: 25px;
}

.user-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    margin: 0 auto 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.user-profile-avatar .default-avatar-large {
    font-size: 48px;
    color: white;
    font-weight: bold;
}

.user-profile-name {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0 5px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.user-profile-username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin: 0;
}

.user-profile-info {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.user-profile-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile-info-item:last-child {
    border-bottom: none;
}

.user-profile-info-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.user-profile-info-value {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.user-profile-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #FFD700;
}

.user-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.user-profile-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.user-profile-stat-value {
    color: white;
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.user-profile-stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Настройки звука */
.user-profile-settings {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-top: 15px;
}

.user-profile-settings-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.user-profile-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile-setting-item:last-child {
    border-bottom: none;
}

.user-profile-setting-label {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* Toggle switch */
.user-profile-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.user-profile-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.user-profile-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.4s;
    border-radius: 34px;
}

.user-profile-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.user-profile-toggle input:checked + .user-profile-toggle-slider {
    background-color: #4CAF50;
}

.user-profile-toggle input:checked + .user-profile-toggle-slider:before {
    transform: translateX(24px);
}

/* Адаптивность */
@media (max-width: 640px) {
    .user-profile-button {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        border: 2px solid #fff;
    }
    
    .user-profile-content {
        width: 95%;
        max-width: 100%;
        padding: 20px 15px;
        border-radius: 15px;
        max-height: 85vh;
    }
    
    .user-profile-avatar {
        width: 70px;
        height: 70px;
        border: 3px solid white;
    }
    
    .user-profile-name {
        font-size: 20px;
    }
    
    .user-profile-username {
        font-size: 14px;
    }
    
    .user-profile-info,
    .user-profile-settings {
        padding: 15px;
    }
    
    .user-profile-info-item,
    .user-profile-setting-item {
        padding: 10px 0;
    }
    
    .user-profile-info-label,
    .user-profile-setting-label {
        font-size: 14px;
    }
    
    .user-profile-info-value {
        font-size: 14px;
        max-width: 55%;
    }
    
    .user-profile-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .user-profile-stat {
        padding: 12px 8px;
    }
    
    .user-profile-stat-value {
        font-size: 20px;
    }
    
    .user-profile-stat-label {
        font-size: 11px;
    }
    
    .user-profile-settings-title {
        font-size: 16px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .user-profile-content {
        padding: 15px 10px;
        max-height: 90vh;
    }
    
    .user-profile-avatar {
        width: 60px;
        height: 60px;
    }
    
    .user-profile-name {
        font-size: 18px;
    }
    
    .user-profile-stats {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .user-profile-stat {
        padding: 10px;
    }
}

/* Кнопка "Друзья" */
.user-profile-actions {
    margin: 20px 0;
}

.user-profile-friends-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.user-profile-friends-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.user-profile-friends-btn:active {
    transform: translateY(0);
}

.friends-btn-icon {
    font-size: 24px;
}

.friends-btn-text {
    flex: 1;
    text-align: center;
    margin: 0 10px;
}

.friends-btn-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.user-profile-friends-btn:hover .friends-btn-arrow {
    transform: translateX(5px);
}

/* Правила игры */
.user-profile-rules-link {
    padding: 0 !important;
    border-bottom: none !important;
    margin-top: 15px;
}

.user-profile-rules-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(245, 87, 108, 0.3);
}

.user-profile-rules-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(245, 87, 108, 0.5);
}

.user-profile-rules-btn:active {
    transform: translateY(0);
}

.rules-btn-icon {
    font-size: 22px;
}

.rules-btn-text {
    flex: 1;
    text-align: center;
    margin: 0 10px;
}

.rules-btn-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.user-profile-rules-btn:hover .rules-btn-arrow {
    transform: translate(3px, -3px);
}

/* Планшеты */
@media (min-width: 641px) and (max-width: 1024px) {
    .user-profile-button {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .user-profile-content {
        max-width: 500px;
        padding: 25px;
    }
}

