/* Identidad visual: avatar + nombre */
.user-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #1e293b;
    border: 2px solid rgba(251, 146, 60, 0.45);
}
.user-avatar--xs { width: 24px; height: 24px; }
.user-avatar--sm { width: 32px; height: 32px; }
.user-avatar--md { width: 48px; height: 48px; }
.user-avatar--lg { width: 80px; height: 80px; }
.user-avatar--xl { width: 96px; height: 96px; }

.user-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.user-identity--stack {
    flex-direction: column;
    text-align: center;
    gap: 0.35rem;
}
.user-identity__name {
    font-weight: 600;
    truncate: ellipsis;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-avatar-btn {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-avatar-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.35);
}
.profile-avatar-btn__hint {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ea580c;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.avatar-picker-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.avatar-picker-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(30, 41, 59, 0.35);
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.avatar-picker-tab:hover {
    border-color: rgba(251, 146, 60, 0.55);
    background: rgba(51, 65, 85, 0.55);
}
.avatar-picker-tab.is-active {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.18);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
}
.avatar-picker-tab.is-locked:not(.is-active) {
    opacity: 0.72;
}
.avatar-picker-tab__lock {
    font-size: 0.75rem;
    line-height: 1;
}

.avatar-picker-panel {
    position: relative;
    min-height: 200px;
}

.avatar-picker-locked--banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px dashed rgba(251, 191, 36, 0.45);
    text-align: center;
}
.avatar-picker-locked__icon {
    font-size: 1rem;
    line-height: 1;
}
.avatar-picker-locked__title {
    flex: 1 1 100%;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fde68a;
    line-height: 1.35;
}
.avatar-picker-locked__hint {
    flex: 1 1 100%;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #94a3b8;
}

#avatarPickerModal .avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    max-height: min(55vh, 480px);
    overflow-y: auto;
    padding: 4px;
}
.avatar-picker-item {
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
    transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}
.avatar-picker-item:hover:not(.is-locked) {
    border-color: rgba(251, 146, 60, 0.5);
    background: rgba(51, 65, 85, 0.6);
}
.avatar-picker-item.is-selected:not(.is-locked) {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.15);
    box-shadow: 0 0 0 1px #f97316;
}
.avatar-picker-item.is-locked {
    cursor: not-allowed;
    opacity: 0.82;
    background: rgba(15, 23, 42, 0.45);
}
.avatar-picker-item.is-locked:hover {
    border-color: rgba(251, 191, 36, 0.35);
}
.avatar-picker-item.is-locked.is-selected {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: none;
}
.avatar-picker-item__media {
    position: relative;
    display: block;
    width: 56px;
    margin: 0 auto;
}
.avatar-picker-item img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.avatar-picker-item.is-locked img {
    filter: grayscale(0.35) brightness(0.88);
}
.avatar-picker-item__lock {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(251, 191, 36, 0.65);
    font-size: 10px;
    line-height: 18px;
    text-align: center;
}
#avatarPickerModal .avatar-picker-grid.is-tier-locked {
    opacity: 0.98;
}

.nav-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* Banner de hitos de intercambios → desbloqueo de iconos */
.trade-milestone-info > summary {
    list-style: none;
}

.trade-milestone-info > summary::-webkit-details-marker {
    display: none;
}

.trade-milestone-info__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(249, 115, 22, 0.35);
    background: rgba(255, 255, 255, 0.9);
    color: #ea580c;
    font-size: 0.875rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.trade-milestone-info__btn:hover,
.trade-milestone-info[open] > .trade-milestone-info__btn {
    background: #ea580c;
    color: #fff;
}

.trade-milestone-info__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 30;
    width: min(18rem, 90vw);
    padding: 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(249, 115, 22, 0.25);
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.dark .trade-milestone-info__panel {
    background: #1f2937;
    border-color: rgba(249, 115, 22, 0.35);
}

@media (max-width: 640px) {
    .avatar-picker-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.35rem;
        padding-bottom: 0.25rem;
    }
    .avatar-picker-tab {
        flex: 0 0 auto;
        min-height: 40px;
        white-space: nowrap;
    }
    #avatarPickerModal .avatar-picker-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.5rem;
    }
}
